NathanFriend.co.uk

Developers notebook

Category: Programing (page 2 of 5)

Find where Moodle 2+ has put your file

When you upload a file to a course it get assigned a hashvalue and stored in the /moodledata/filedir directory

To find out where, search the moodle database for the filename:

SELECT contenthash FROM mdl_files WHERE filename = ‘myfile.doc’;

This will return something like fb9d09535c7fce57abaa6f8a264137c39bea923b

Navigate to your moodledata/filedir and search for the hash:

find . -name fb9d09535c7fce57abaa6f8a264137c39bea923b

Take a copy, restoring the original name:

cp fb9d09535c7fce57abaa6f8a264137c39bea923b myfile.doc

Keep flash object behind other elements

<param name=”wmode” value=”transparent”>

Source: http://css-tricks.com/snippets/html/keep-flash-behind-other-elements/

Fork me on github

Found this CSS “Fork me on github” ribbon, http://simonwhitaker.github.com/github-fork-ribbon-css/

Bread crumb trail helper for codeigniter

Found this super simple Bread Crumb trail helper for codeigniter http://ellislab.com/forums/viewthread/137949/

Add an admin user to the wordpress database MySQL

INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('4', 'demo', MD5('demo'), 'Syed Balkhi', 'test@yourdomain.com', 'http://www.wpbeginner.com/', '2011-06-07 00:00:00', '', '0', 'Syed Balkhi');
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_user_level', '10');

Orignal source http://www.wpbeginner.com/wp-tutorials/how-to-add-an-admin-user-to-the-wordpress-database-via-mysql/

Android jump to bottom of scroll view onClick

In your activity define a method.  In this example “scroll” is the id of the scroll view.  Then set your button onClick attribute to JumpToEnd.

public void JumpToEnd(View V){

ScrollView sv = (ScrollView)findViewById(R.id.scroll);

sv.scrollTo(0, sv.getBottom());

}

Moodle 2.3 is here

http://moodle.org/mod/forum/discuss.php?d=205466&utm_source=twitterfeed&utm_medium=twitter

Moodle iLP2.0 developer documentation

Collaborative notebook of discoveries so far in the ULCC iLP 2.0 Moodle block.

https://docs.google.com/document/d/1jk-HRExKDIdc9bAGehrdJ2XOo4klZLqk9io3JTfDbKg/edit?pli=1

mod_rewrite on SuSe

edit /etc/sysconfig/apache2

Add rewrite inside the speech marks for APACHE_MODULES=”rewrite, other modules…”

edit /etc/apache2/default-server.conf

Change AllowOverride None to AllowOverride All

apache2ctl restart

Source http://enarion.net/web/htaccess/mod_rewrite-on-suse/

Create a new MySQL user

CREATE USER ‘user1’@’localhost’ IDENTIFIED BY ‘pass1’;

GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO ‘user1’@’localhost’;

Source http://www.databasef1.com/tutorial/mysql-create-user.html

« Older posts Newer posts »

© 2022 NathanFriend.co.uk

Theme by Anders NorénUp ↑