Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sh78 on github.
  • I am shender (https://keybase.io/shender) on keybase.
  • I have a public key ASDjMk3OJAoTviXz8UqEbjTnKCST9qaW5RWKcLKDcID1tgo

To claim this, I am signing this object:

Hints.characters = 'yuiophjklnm'; // for right hand
// Disable by default on certain domains
// Instead of pressing alt+s
// settings.blacklistPattern = /.*mail.google.com.*|todoist.com\/app/i;
map(';pa', ':setProxyMode clear');
// Vim editor bindings
aceVimMap('jk', '<Esc>', 'insert');
window.onload = function(){
c = document.getElementById("myCanvas");
cc = c.getContext("2d");
setInterval(update, 1000/30);
};
var c = document.getElementById("myCanvas");
var cacX1 = 960;
var dy = document.getElementById("myCanvas").height - 60;
var speed = -1;
var drop = -7;
#!/usr/bin/env python3
import fileinput
import re
##
# Extract URLs from file or `stdin`
#
# Prints out a standard list of url address substrings contained in `fileinput`
# Call on a file or pipe to `stdin`
#
# write date created to date modified
## `GetFileInfo -d $file` gives us 01/28/2007 22:56:00
# we need "YYYYMMDDhhmm" for `touch -mt` to set modification time
set tally 0
for file in (find ./ -maxdepth 1)
set dateString "" # final result goes here
set cuts "7-10" "1-2" "4-5" "12-13" "15-16" # string indices to extract
for cut in $cuts
set dateString $dateString(GetFileInfo -d $file | cut -c $cut)
end
#!/usr/bin/env python3
import fileinput
import re
##
# Extract email addresses from file or `stdin`
#
# Prints out a standard list of email address substrings contained in `fileinput`
# Call on a file or pipe to `stdin`
#
/**
* Format a date like YYYY-MM-DD.
*
* @param {string} template
* @param {Date=} [date]
* @return {string}
* @license MIT
*/
function formatDate(template, date) {
# Caching
# http://davidwalsh.name/html5-boilerplate-htaccess
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 year"
# 301 Redirects for .htaccess
# Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
# Redirect an entire site:
Redirect 301 / http://www.domain.com/
# Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
# add another . for 4-letter file extensions
ls -1 | sed -e 's/\....\*$//'