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
/* Decimal to simplified fraction (using the Euclidean algorithm) | |
---------------------------------------------------------------------------------- */ | |
@function fraction($num) { | |
$top: $num * 100; | |
$bottom: 100; | |
$return: ''; | |
$a: abs($top); $b: abs($bottom); |
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/bash | |
URL="http://support.apple.com/downloads/DL1760/en_US/OSXUpdCombo10.9.5.dmg" | |
if [[ ! -f /tmp/OSXUpdCombo10.9.5.dmg ]]; then | |
echo 'Downloading 10.9.5 Combo...' | |
curl -Lo /tmp/OSXUpdCombo10.9.5.dmg $URL | |
fi | |
if [[ ! -d /tmp/ComboMount ]]; then |
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/bash | |
# Email search script | |
# by Stan Hutcheon | |
if [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]]; then | |
echo 'usage: emailsearch [volume] [user] [backupname] [backupvolume] [query]' | |
exit | |
fi |
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
<% require javascript('https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.0') %> | |
<div class="{$ClassName}"> | |
<div id="fb-root"></div> | |
<div class="fb-share-button" data-href="{$URL}" data-layout="<% if Type %>{$Type}<% else %>button<% end_if %>"></div> | |
</div> |
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() { | |
/* resize textarea based on text content (with IE8 support & no fixed heights or pseudo-divs!) */ | |
// jquery | |
var textarea = $('textarea'); | |
if(textarea.length) textarea.on('input propertychange', function() { | |
this.rows = ((this.value || '').match(/(\r?\n)/mg) || []).length + 1; | |
}).trigger('input'); | |
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
<?php | |
/** | |
* Put {$Livereload} just before the end of the closing body tag | |
*/ | |
class LivereloadProvider implements TemplateGlobalProvider { | |
public static function get_template_global_variables() { | |
return array( |
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
16:55:44.153146 IP (tos 0x0, ttl 64, id 36489, offset 0, flags [DF], proto TCP (6), length 499) | |
192.168.1.75.61121 > uklon5-vip-bx-005.aaplimg.com.http: Flags [P.], cksum 0xf2a1 (correct), seq 3793543519:3793543966, ack 397515557, win 4117, options [nop,nop,TS val 1971128429 ecr 138026923], length 447 | |
N..l'........E.....@[email protected]..#....P..._...%........... | |
u}.m.:..GET /apple-assets-us-std-000001/Purple3/v4/74/d2/82/74d28291-9db9-7ae2-305d-9b8b3f5fd463/ftk3252456602304584541.pkg HTTP/1.1 | |
Host: osxapps.itunes.apple.com | |
Accept: */* | |
Connection: keep-alive | |
iCloud-DSID: XXXXXXXXXX | |
Range: bytes=2711126016- | |
Date: Thu, 01 Oct 2015 15:55:44 GMT |
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/bash | |
# removes various files related to stored iChat/Messages data on disk | |
# ran through launchd. relies on compiled applescript to fully remove all conversation traces | |
# will not run if the system is in use, unless the system has been idle for the amount of minutes below | |
TIMEOUT=15 | |
## start ## |
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
/* ie placeholders */ | |
$('[placeholder]').on('focus blur', function() { | |
var h = this.getAttribute('placeholder'), v = this.value; | |
this.value = !v && h || ((v != h) && v || ''); | |
}).trigger('blur'); |
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/bash | |
# checks if a process has ran for n seconds, and kills it if so | |
# - usage killafter <procname> <seconds> | |
func="$1" | |
timeout="$2" | |
green="\033[31m" | |
red="\033[31m" |
OlderNewer