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 ruby | |
# maze.rb | |
class Integer | |
def odd? | |
self % 2 == 1 | |
end | |
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 | |
# | |
# init.d script for single or multiple unicorn installations. Expects at least one .conf | |
# file in /etc/unicorn | |
# | |
# Modified by 5thWall@gmail.com http://github.com/5thWall | |
# based on https://gist.github.com/504875 by http://github.com/jaygooby | |
# | |
## A sample /etc/unicorn/my_app.conf | |
## |
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 'nokogiri' | |
@doc = Nokogiri::HTML File.open($*[0]) | |
if $*[1] != nil | |
iclass = $*[1] | |
ital = @doc.css "span.#{iclass}" | |
ital.each do |n| | |
n['class'] = n['class'].gsub(/#{iclass}/, "").strip | |
i = Nokogiri::XML::Node.new "i", @doc |
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
# Originally written by Github: | |
# https://help.github.com/articles/working-with-ssh-key-passphrases | |
SSH_ENV="$HOME/.ssh/environment" | |
# start the ssh-agent | |
function start_agent { | |
echo "Initializing new SSH agent..." | |
# spawn ssh-agent | |
ssh-agent | sed 's/^echo/#echo/' > "$SSH_ENV" |
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
Show hidden characters
{ | |
"color_scheme": "Packages/Solarized Color Scheme/Solarized (dark).tmTheme", | |
"detect_indentation": true, | |
"draw_indent_guides": true, | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
".DS_Store", | |
".tags*", | |
"*.pyc", |
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
/* Change header size */ | |
#header-img { | |
width: 150px; | |
height: auto; | |
} | |
/* end header */ | |
/* Change vote icons */ | |
.arrow.upmod { | |
background:url(%%votes%%); |
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
export TERM=msys | |
# Aliases | |
alias please='sudo' | |
alias ls='ls --color=auto' | |
alias subl='/c/Program\ Files/Sublime\ Text\ 2/sublime_text.exe' | |
alias releasenotes="git log --oneline --no-merges `git describe --abbrev=0 --tags`..HEAD | cut -c 9- | sort | subl" | |
## Navigation | |
alias assets='cd ~/src/assets/' |
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
// LINQ all the things | |
bool FilesValid(HttpFileCollection files, IEnumerable<String> allowedExtensions) | |
{ | |
return files.AllKeys.Select(s => files[s]) | |
.Any(fi => !AllowedExtensions.Any(s => fi.FileName.EndsWith(s))); | |
} | |
// LINQ some of the things | |
bool FilesValid(HttpFileCollection files, IEnumerable<String> allowedExtensions) | |
{ |
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
// Sort command for money columns with the stupidtable library. | |
// https://github.com/joequery/Stupid-Table-Plugin | |
$("selector").stupidtable({ | |
"cash": function(a, b) { | |
reg = /\$(\d,?\d*\.\d{2})/; | |
aCash = reg.exec(a)[1].replace(',', ''); | |
bCash = reg.exec(b)[1].replace(',', ''); | |
return parseFloat(aCash) - parseFloat(bCash); |
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
thinksyncDirectives = angular.module('thinksyncDirectives', []); | |
thinksyncDirectives.directive('tsTouchstart', function() { | |
return function(scope, element, attr) { | |
element.on('click', function(event) { | |
scope.$apply(function() { | |
fn(scope, {$event:event}); | |
}); | |
}); | |
}; |
OlderNewer