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
if /(?<hour>\d?\d)\:(?<min>\d\d)(?<suffix>[pa]m)/ =~ "5:03pm" | |
puts hour | |
puts min | |
puts suffix | |
end |
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
#!/bin/sh | |
# script for optimizing images in a directory (recursive) | |
# pngcrush & jpegtran settings from: | |
# http://developer.yahoo.com/performance/rules.html#opt_images | |
# pngcrush | |
for png in `find $1 -iname "*.png"`; do | |
echo "crushing $png ..." | |
pngcrush -rem alla -reduce -brute "$png" temp.png |
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
(function ($) { | |
function background_image_url($object) { | |
var string = $object.css('backgroundImage'), | |
url_regex = /[("]([^()"]+)[")]/; | |
return url_regex.exec(string)[1]; | |
} | |
$.fn.preload_background_image = function () { | |
return $(this).each(function () { | |
(new Image()).src = background_image_url($(this)); |
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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
// | |
// Sass rotation mixin for IE6+ | |
// | |
@mixin ms-rotate($degrees) { | |
@if (not unitless($degrees)) { $degrees: $degrees / 1deg } | |
$deg2rad: pi() * 2 / 360; | |
$radians: $degrees * $deg2rad; | |
$costheta: cos($radians); | |
$sintheta: sin($radians); |
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
view.on("touchstart", function(e) { | |
var touch = event.touches[0] | |
//Grab the initial touch coordinates | |
xInit = touch.pageX | |
yInit = touch.pageY | |
}) | |
view.on("touchmove", function(e) { | |
var touch = event.touches[0] | |
xCurrent = touch.pageX |
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/env python | |
import os | |
import sys | |
import shutil | |
import subprocess | |
if len(sys.argv) < 3: | |
sys.exit("Usage: python sign.py <identity> <myApp.app>") |
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
/* | |
Minimal Facebook Messenger | |
========================== | |
1. Make a Fluid (http://fluidapp.com/) instance of https://facebook.com/messages/ | |
1. a. (You need to buy the paid version of Fluid to modify UserStyles) | |
2. Apply the below CSS as a Userstyles stylesheet | |
3. Like magic, you can now message without all the cruft of Full Facebook | |
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
#Paste in Preferences > Sidebar Theme > Click thing at the bottom to expose the input and copy pasta this guy in there | |
#111111,#111111,#333333,#FFFFFF,#444444,#FFFFFF,#FFFFFF,#FF0000 |
OlderNewer