This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Randomize database server connection | |
| $server = array( | |
| 'sql1', | |
| 'sql2', | |
| 'sql3', | |
| ); | |
| $rand = rand(0,count($server)-1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $domains = array( | |
| 'jonasbjork.net', | |
| 'google.com', | |
| 'idg.se', | |
| 'facebook.com', | |
| 'aftonbladet.se' ); | |
| foreach ($domains as $d) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| date_default_timezone_set('Europe/Stockholm'); | |
| // sunday = 0; | |
| $day = date("w"); | |
| print $day; | |
| if ($day == 1) { | |
| $d = strtotime(date("Y-m-d", time())); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class StrArray { | |
| private $arr = array(); | |
| /** | |
| * Adds string "a=b" to array with a as key and b as value | |
| * | |
| * @author Jonas Björk <jonas.bjork@me.com> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Get database connection string from a wp-config.php file. | |
| * | |
| * Usage: php db.php /var/www/wp-config.php | |
| * | |
| * Output: mysql -h DB_HOST -u DB_USER -pDB_PASSWORD DB_NAME | |
| * | |
| * @author Jonas Björk <jonas.bjork@me.com> | |
| * @date 2012-12-04 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Deskhide - hides ALL icons on your desktop | |
| # (C)2013 Jonas Björk <jonas.bjork@me.com> | |
| # Licensed under GNU GPLv2+ | |
| # | |
| # You must make this script executable: "chmod +x deskhide" | |
| # Then start Terminal.App, iTerm.App or another terminal | |
| # and run this program with: | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #Set these variables! | |
| PRIOCARD=""; # Your SJ Prio card number (Black) | |
| CARDPASS=""; # Your SJ Prio card code (4 digits) | |
| #There is normally no need to modify anything below... | |
| URL="https://www.ombord.info/hotspot/hotspot.cgi"; | |
| AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.142 Safari/535.19"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| VERSION=$(VBoxManage --version) | |
| MAJOR=$(echo ${VERSION} | awk -F'r' '{print $1}') | |
| MINOR=$(echo ${VERSION} | awk -F'r' '{print $2}') | |
| DOWNLOAD="http://download.virtualbox.org/virtualbox/${MAJOR}/Oracle_VM_VirtualBox_Extension_Pack-${MAJOR}-${MINOR}.vbox-extpack" | |
| wget $DOWNLOAD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Install nvm from https://github.com/creationix/nvm | |
| curl https://raw.githubusercontent.com/creationix/nvm/v0.5.1/install.sh | sh | |
| # Read nvm settings | |
| source ~/.profile | |
| # Install NodeJS version | |
| nvm install 0.10.26 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tell application "OmniFocus" | |
| tell front document to make new inbox task with properties {name:"Testing Apple Script task", note:"There is no note."} | |
| end tell |