This file contains 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
# skip admin directory | |
RewriteCond %{REQUEST_URI} !^/admin | |
# rule | |
RewriteRule ... |
This file contains 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
# create an .htaccess file in the directory to protect | |
AuthUserFile /full/path/to/.htpasswd | |
AuthType Basic | |
AuthName "My Secret Folder" | |
Require valid-user | |
#create the password with this command | |
htpasswd -c /full/path/to/.htpasswd fred | |
# Now go to http://yourserver/protecteddir/ and insert username:fred, password (the one you inserted after the last command) |
This file contains 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
<meta http-equiv="refresh" content="5;url=http://example.com/" /> |
This file contains 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
<!-- displays the following warning, then hide immediately with javascript. | |
If javascript is not enabled, the message will be displayed. No JQuery needed --> | |
<p id="jsenabled" style="color:red">Javascript must be enabled to use the form !</p> | |
<script type="text/javascript"> | |
document.getElementById('jsenabled').innerHTML=''; | |
document.getElementById('jsenabled').style.display = 'none'; | |
</script> |
This file contains 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
# .htaccess or Apache vhost | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} !^www\. | |
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] | |
This file contains 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
"/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome" --disable-web-security --user-agent="Android" --user-data-dir="C:/temp-chrome-app" --app=file:///C:/path/to/app.html" |
This file contains 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
javascript:var links=document.getElementsByTagName("link"); for (var i = 0; i < links.length;i++) { var link = links[i]; if (link.rel === "stylesheet") {link.href += "?"; }}; return false |
This file contains 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
$(document).ready(function() { | |
/* | |
* Attach a "onchange" listener to file upload elements for each form. | |
* Behaviour: | |
* If the selected file size invalid (bigger than the value from the <input name="MAX_FILE_SIZE" /> element): | |
* - disable submit button | |
* - append a message (class="errors") to the form. | |
* If the selected file size is valid: | |
* - enable the submit button | |
* - remove the error message previously added |
This file contains 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
# add STRING-XXXXXXX to FILE-YYYYYY | |
# if commented out, it gets re-added | |
exec { "[task name]": | |
command => '/bin/echo "STRING-XXXXXXX" >> FILE-YYYYYY', | |
unless => '/bin/grep -E "^STRING-XXXXXXX$" FILE-YYYYYY' | |
} |
This file contains 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
# gitcommit this message will be commited, with the branch name prepended | |
# e.g. (on branch feature01) | |
# > gitcommit this is the commit message | |
# > Committed with message "feature01 this is the commit message" | |
gitcommit() { | |
gm_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p'); | |
gm_commitMessage="${gm_branch} $@" | |
git commit -m "${gm_commitMessage}" | |
echo Committed with message \"$(git log -n1 --pretty=format:%s)\" | |
} |
OlderNewer