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
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0 | 20110126 | |
License: none (public domain) */ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, | |
b, u, i, center, |
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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
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
Here is a list of scopes to use in Sublime Text 2 snippets - | |
ActionScript: source.actionscript.2 | |
AppleScript: source.applescript | |
ASP: source.asp | |
Batch FIle: source.dosbatch | |
C#: source.cs | |
C++: source.c++ | |
Clojure: source.clojure | |
CoffeeScript: source.coffee |
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
// 'map', 'transform', 'select', or 'project' function. Iterate over a list, | |
// performing a function on each item, and collecting the new items. Each | |
// function takes an item as a first argument and returns a transformed item. | |
// You can pass additional arguments to the function too, which is a decent poor | |
// man's function composition. | |
// (I didn't call this f-map because the term 'map' is already used in Sass to | |
// denote a hash or dictionary.) | |
@function f-apply($func, $list, $args...) { | |
$new-list: (); | |
@each $item in $list { |
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 f = function() { | |
var v = speechSynthesis.getVoices().filter(function(v) { return v.name == 'Hysterical'; })[0], | |
s = ["ahahahaha", "stop it", "don't tickle me"], | |
t = new SpeechSynthesisUtterance(s[~~(Math.random()*s.length)]); | |
t.voice = v; speechSynthesis.speak(t); | |
}; | |
Array.prototype.slice.call(document.querySelectorAll('a')).forEach(function(a) { | |
a.addEventListener('mouseover', f); | |
}); |
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 | |
// simple technique to remove bugs from your code | |
// example buggy code | |
$your_code = "<html><Oh man>i hope i don't have any American cockroaches in my code</Oh man></html>"; | |
$list_of_bugs = array('American cockroach', 'Ants', 'Aphids', 'Aphids', 'Asian paper wasp', | |
'Asian paper wasp nest', 'Assassin bug', 'Australian bag moth', 'Australian bag moth pupa', | |
'Avondale spider', 'Backswimmer', 'Bamboo moth', 'Banana moth', 'Banana moth pupa', |
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
# This script will create a cron that downloads the latest image from Himawari 8 every 5 minutes. I use it as my wallpaper. | |
# | |
# The Himawari 8 weather satellite acquires 5500x5500 images of Earth every 10 minutes. It captures other weather related | |
# stills but the full disk, true color is the most amazing. | |
# The latest is accessible at | |
# http://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/full_disk_ahi_true_color.jpg. | |
# | |
# The satellite was launched in July of 2015. It's the highest resolution | |
# camera we currently have pointing at earth (stationary at the L1 point). | |
# |
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/perl | |
while (<>) { | |
if(/^diff --git a\/(\S+)/) { | |
close $f if $f; | |
$s=$1; | |
$s =~ s:(/|\.):_:g; | |
$n=sprintf("%03d_%s.patch", ++$i, $s); | |
open $f, ">", $n; | |
print $f $_; |