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
| # Ruby, Generate sql PLZ | |
| require 'faker' # faker gem used to generate names/addresses/phone numbers | |
| def gen_sql(tname, v) | |
| id = 1 | |
| 10.times do | |
| s = "INSERT INTO #{tname} (#{v.keys.join(",")}) VALUES (" | |
| o = [] | |
| v.values.each do |a| | |
| if a == :id |
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
| str1 = "hello my name is jake" | |
| str2 = "mah name is greg" | |
| def printdiff(c, x, y, i, j) | |
| return if c.nil? | |
| if i > 0 and j > 0 and x[i] == y[j] | |
| printdiff(c,x,y,i-1,j-1) | |
| puts " " + x[i] unless x[i].nil? | |
| elsif j > 0 and (i == 0 or c[i][j-1] >= c[i-1][j]) | |
| printdiff(c,x,y,i,j-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
| require 'curses' | |
| include Curses | |
| str1 = "hello my name is jake" | |
| str2 = "mah name is greg" | |
| init_screen | |
| start_color | |
| crmode | |
| noecho |
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
| LIBS="libname1 libname2" | |
| IGNOREFILES := file1.c file2.c | |
| BIN=binname | |
| CC=gcc-4.9 | |
| ########################################################### | |
| #### NOTHING SHOULD NEED TO BE CHANGED BELOW THIS LINE #### | |
| ########################################################### | |
| # Compiler options |
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
| -- This gist uses http://luapower.com/objc.html as an FFI. I think it works on it's own, but I would recommend | |
| -- getting the whole LuaPower project, because all the libraries rock. | |
| -- | |
| -- This script will open a window that displays two rectangles. One red and one blue. | |
| local glue = require'glue' | |
| local objc = require'objc' | |
| local ffi = require'ffi' | |
| local pp = require'pp' |
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
| # Converts an animated gif to a spritesheet using ImageMagick | |
| file_name=$(echo $1 | sed 's/\(.*\)\..*/\1/') | |
| montage $1 -tile x1 -geometry '1x1+0+0<' -alpha On -background "rgba(0, 0, 0, 0.0)" -quality 100 $file_name.png |
NewerOlder