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
# Cooking Converter Project Ver1.03 | |
"""Changelog | |
ver1.03 | |
- removed clearscreen function for now | |
- units now print full names | |
- script gives plural unit when necessary | |
- fractions implemented but not printing human-readable | |
""" | |
from __future__ import division |
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/bash | |
count=0 | |
# grab remote merged branches, ignoring master and HEAD | |
for x in `git branch --merged master -r --column | grep -v HEAD | grep -v master`; do | |
branch="${x/origin\//}" | |
mod=$(git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $x | head -n 1) | |
# get the number of commits the remote branch is behind/ahead of master | |
set -- $(git rev-list --left-right --count origin/$branch...origin/master) | |
ahead=$1 |
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/bash | |
_check_options() { | |
while test $# -gt 0; do | |
case "$1" in | |
-h|--help) | |
echo "options:" | |
echo "-h, --help show brief help" | |
echo "-r, --remote=ORIGIN remote repository to target" | |
exit 0 | |
;; |
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
def merge_sort(array_a, array_b) | |
(array_a + array_b).sort | |
end | |
merge_sort([3,1,7,5,9], [4,2,6,8,0]) | |
# => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] |
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
$('#coverflip').jcoverflip({ | |
current: flipItemCount, | |
beforeCss: function( el, container, offset ){ | |
console.log(container); | |
return [ | |
$.jcoverflip.animationElement( el, { 'transform':'skew(0deg, 30deg)', left: ( container.width( )/2 - 280 - 190 *offset )+'px', bottom: '60px' }, {}), | |
$.jcoverflip.animationElement( el.find( 'img' ), { opacity: 0.7, width: '175px', height: '175px' }, {} ) | |
]; | |
}, | |
afterCss: function( el, container, offset ){ |
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
// Make sure you have a parent element that wraps the checkboxes you want to check has an ID set | |
// in this case it's "interest" - so <fieldset id="interest">. | |
$('#checkall').click(function(e) { | |
e.preventDefault(); | |
$('#interest').find('input[type="checkbox"]').each(function(item) { | |
if ($(this).attr('checked')) { | |
$(this).attr('checked', false); | |
} else { | |
$(this).attr('checked', true); |
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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
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
#!/usr/bin/osascript | |
-- setting to return focus to the initial calling app (in my case it's Textmate) | |
set callingApp to (path to frontmost application as Unicode text) | |
-- tell application "Google Chrome" | |
-- activate | |
-- end tell | |
-- | |
-- tell application "System Events" |
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 | |
// this follows the assumption that you've already instantiated the facebook SDK | |
// e.g. $facebook = new Facebook(); | |
// The key is the first api() call - you need to try to access something which requires the access token | |
// you are attempting to validate. | |
// e.g. if your access token has *no* special permissions you could use $facebook->api('/me'), | |
// which is the most basic permission level. | |
try { |