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
<!-- Get the favicon image of any website with various services --> | |
<img src="http://g.etfv.co/http://www.google.com"> | |
<img src="https://getfavicon.appspot.com/http://www.google.com?defaulticon=lightpng"> | |
<img src="http://www.google.com/s2/favicons?domain=google.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
# set bandwidth limit, response delay and lost packages : | |
sudo ipfw pipe 1 config bw 56Kbit/s delay 200 plr 0.2 | |
sudo ipfw add 1 pipe 1 ip from any to any | |
# Restore by removing the pipe : | |
# sudo ipfw delete 1 |
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
// https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage | |
if (!window.localStorage) { | |
window.localStorage = { | |
getItem: function (sKey) { | |
if (!sKey || !this.hasOwnProperty(sKey)) { return null; } | |
return unescape(document.cookie.replace(new RegExp("(?:^|.*;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*"), "$1")); | |
}, | |
key: function (nKeyId) { | |
return unescape(document.cookie.replace(/\s*\=(?:.(?!;))*$/, "").split(/\s*\=(?:[^;](?!;))*[^;]?;\s*/)[nKeyId]); |
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
// ☰ ☰ | |
// ‣▴▾✖︎✕✔︎✓►◀︎▼▲ |
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
/usr/bin/osascript -e 'do shell script "/path/to/myscript args 2>&1 etc" with administrator privileges' |
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
# Sample anacrontab usage on Gandi Simple hosting | |
# | |
# Does a daily mysql backup and delete 1 week old backups | |
# | |
# SFTP : lamp0/etc/cron/anacron/anacrontab | |
# SSH : /srv/data/etc/cron/anacron/anacrontab | |
@daily 0 mysql_backup mkdir /srv/data/tmp/mysql_backup ; mysqldump -h localhost -u root {-pPASSWORD} --all-databases > /srv/data/tmp/mysql_backup/`date '+%F'`.databases.sql ; rm /srv/data/tmp/mysql_backup/`date '+%F' --date '1 weeks ago'`.databases.sql |
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.getElementById('id').classList.add('class'); | |
document.getElementById('id').classList.remove('class'); | |
document.getElementById('id').classList.toggle('class'); |
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
// Avoid `console` errors in browsers that lack a console. | |
(function() { | |
var method; | |
var noop = function () {}; | |
var methods = [ | |
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', | |
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', | |
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', | |
'timeStamp', 'trace', 'warn' | |
]; |
NewerOlder