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/env python | |
| # coding=utf-8 | |
| # -*- coding: utf-8 -*- | |
| import os | |
| import random | |
| marvin = [ | |
| "DON'T PANIC!", | |
| "Ah, a vida. Pode-se odiá-la ou ignorá-la, mas é impossível gostar dela.", |
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
| vendor(prop, args) | |
| -webkit-{prop} args | |
| -moz-{prop} args | |
| -ms-{prop} args | |
| -o-{prop} args | |
| {prop} args | |
| border-radius() | |
| vendor('border-radius', arguments) |
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/sh | |
| export GIT_DIR=$(pwd) | |
| cd /var/www/path/to/server/ | |
| git checkout -f master | |
| git checkout -f developer |
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/sh | |
| #path to project on server | |
| GIT_WORK_TREE=/var/www/path/to/project/ git checkout -f | |
| # other instructions on deploy | |
| cd /var/www/path/to/project | |
| # Compile Stylus | |
| stylus --include /usr/local/lib/node_modules/nib/lib app/static/style/main.styl | |
| stylus app/static/style/tab.styl |
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/sh | |
| #path to project on server | |
| GIT_WORK_TREE=/var/www/path/to/project/ git checkout -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
| #!/usr/bin/env ruby | |
| file="~/Dropbox/Photos/gitshots/#{Time.now.to_i}.jpg" | |
| puts "Taking capture into #{file}!" | |
| system "imagesnap -q -w 3 #{file}" | |
| 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
| function getDayDelta(incomingYear,incomingMonth,incomingDay){ | |
| var incomingDate = new Date(incomingYear,incomingMonth-1,incomingDay), | |
| today = new Date(), delta; | |
| // EDIT: Set time portion of date to 0:00:00.000 | |
| // to match time portion of 'incomingDate' | |
| today.setHours(0); | |
| today.setMinutes(0); | |
| today.setSeconds(0); | |
| today.setMilliseconds(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
| function insertionSort(values) { | |
| var length = values.length; | |
| for(var i = 1; i < length; ++i) { | |
| var temp = values[i]; | |
| var j = i - 1; | |
| for(; j >= 0 && values[j] > temp; --j) { | |
| values[j+1] = values[j]; | |
| } | |
| values[j+1] = temp; | |
| } |
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
| function bubbleSort(values) { | |
| var length = values.length - 1; | |
| do { | |
| var swapped = false; | |
| for(var i = 0; i < length; ++i) { | |
| if (values[i] > values[i+1]) { | |
| var temp = values[i]; | |
| values[i] = values[i+1]; | |
| values[i+1] = temp; | |
| swapped = 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
| function binSearch(values, target) { | |
| return binarySearch(values, target, 0, values.length - 1); | |
| }; | |
| function binarySearch(values, target, start, end) { | |
| if (start > end) { return -1; } //does not exist | |
| var middle = Math.floor((start + end) / 2); | |
| var value = values[middle]; |