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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| var COOKIE_NAME = 'iphone_redirect'; | |
| $go = $.cookie(COOKIE_NAME); | |
| function appstore() { | |
| var answer = confirm("Download the FREE \nTorbay Hotels App today") | |
| if (answer) window.location = "http://itunes.apple.com/app/id532107287?mt=8"; | |
| $.cookie(COOKIE_NAME, 'notice', { path: '/', expires: 10}) | |
| } |
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
| RewriteLog "/web/logs/mywebsite.rewrite.log" | |
| RewriteLogLevel 9 | |
| RewriteEngine On |
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
| # Resizing and compressing images using mogrify & jpegoptim | |
| find hiresbk/ -iname "*.jpg" -exec mogrify -resize '1000>' -limit memory 32 -verbose {} \; | |
| find hiresbk/ -iname "*.jpg" -exec jpegoptim --strip-all {} \; >> log.txt |
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
| #!/usr/bin/bash | |
| filename="$1" | |
| USER=root | |
| PASS= | |
| while read -r line | |
| do | |
| name=$line | |
| hasfound=false |
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
| zcat xxxx-Jan-2015.gz | grep autodiscover | awk '{ SUM +=$10 } END { print SUM/1024/1024 }' |
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
| AuthType Basic | |
| AuthName "Restricted Area" | |
| AuthUserFile /home/{USERNAME}/public_html/{DIRECTORY}/.htpasswd | |
| require valid-user | |
| # You would need to generate the .htpasswd file using a tool like | |
| # http://www.kxs.net/support/htaccess_pw.html |
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
| $ sed -n "/^-- Table structure for table \`emails\`/,/^-- Table structure for table/p" DUMP.sql > DUMP-table.sql |
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 | |
| $char_set = 'utf8'; | |
| // Adds the header information | |
| header('Content-type: text/plain'); | |
| // Runs the SQL query on teh database | |
| $sql = 'SHOW TABLES'; $result = mysql_query($sql) or die( mysql_error() ); |
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
| # Read files from your internal storage (/data/data/com.app.name) | |
| # You cannot read these files directly, but you can move them | |
| # to the external storage and read from there | |
| $ adb shell "run-as com.yourappname ls /data/data/com.yourappname/files/ > /sdcard/Downloads/log.txt" |
OlderNewer