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 python3 | |
from glob import glob | |
from wand.image import Image | |
source_images = glob("S*.png") | |
TOTAL_FRAMES = len(source_images) | |
print("animating %i files" % TOTAL_FRAMES ) |
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 | |
require "RMagick" | |
RESIZE = 0.25 | |
DELAY = 10 | |
FILENAME = "quartz-composer-process.gif" | |
puts "loading image files" |
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
#!/Library/Frameworks/Python.framework/Versions/3.4/bin/python3 | |
# -*- coding: utf-8 -*- | |
import sqlite3 as lite | |
from colourlovers import ColourLovers | |
def getColors(): | |
cl = ColourLovers() | |
colors = cl.colors() | |
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
// see One-time Binding section in Angular docs, | |
// https://docs.angularjs.org/guide/expression | |
angular.module('oneTimeBidingExampleApp', []). | |
controller('EventController', ['$scope', function($scope) { | |
var counter = 0; | |
var names = ['Igor', 'Misko', 'Chirayu', 'Lucas']; | |
/* | |
* expose the event object to the scope | |
*/ |
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
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
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
syntax on | |
set nocompatible " be iMproved, required | |
filetype off " required | |
set shiftwidth=2 tabstop=2 expandtab | |
" tell vim to treat numerals as decimal, not octal. (from Practical Vim book, | |
" pg. 21) | |
set nrformats= |
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
// inspired by http://www.dzone.com/snippets/execute-unix-command-nodejs | |
var exec = require('child_process').exec; | |
var someValue = "contrived: " + 2 * 2; | |
exec('echo "' + someValue + '" | pbcopy'); // "contrived: 4" is now in your clipboard. WARNING: this is destructive, and an overwrite something important if you're not careful. |
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 | |
# adapted from a tweet of @jcoglan -- https://twitter.com/jcoglan | |
%w(such very so much).product(%w(sports goal ref lads)).sample.join(' ') + "!"*rand(1..3) |
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
# change "bundler" to the name of any installed gem (run 'gem list' to see which gems are installed.) | |
# change "mate" to any prefered program that can open a directory. 'open' will open the file tree in Finder on OSX, for instance. | |
# the regex basically strips off the "/lib/<gem-name>.rb" from the "gem which" output. | |
gem which bundler | sed "s/\(.*\)\(.*\/.*\/.*\.rb\)$/\1/" | xargs mate | |
# alternate way | |
gem which bundler | ruby -e "puts gets.match(/(.*)\/lib\/.*/)[1]" | xargs mate |
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 | |
SUP_COUNT = 120 | |
SUP_PADDING = 50 | |
def vertical_pad_message(padding=15) | |
padding.times {puts "\n"} | |
yield | |
padding.times {puts "\n"} | |
end |