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
# This works | |
def columns_array | |
an_array.each do |query| | |
if query.split[0] =~ (/INSERT/) | |
columns_array = query.split(/[()]/)[1].split(',').flatten | |
else | |
next | |
end | |
columns_array | |
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
@stringy = "" | |
@table_header_footer = "" | |
outable = [['1','2','3'],['4','5','6'],['7','8','9']] | |
outable.last.each do |element| | |
@table_header_footer << element.to_s.length | |
end | |
@table_header_footer << "==\n" | |
outable.each do |row| |
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
#Put the following in /usr/local/Cellar/ffmpeg/0.10/share/ffmpeg/libx264-slow.ffpreset | |
coder=1 | |
flags=+loop | |
cmp=+chroma | |
partitions=+parti8x8+parti4x4+partp8x8+partb8x8 | |
me_method=umh | |
subq=8 | |
me_range=16 | |
g=250 |
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
describe Putter do | |
describe "#start" do | |
it "should say i put" do | |
output = double('output') | |
putter = Putter.new | |
output.should_receive(:puts).with('i put') | |
putter.start | |
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
#!/usr/bin/env ruby | |
(`defaults domains`).split(', ').each do |thing| | |
# p thing uncomment to watch the domains | |
if thing.match /com\.apple.*/ | |
default = "\n\n#{thing}\n" | |
default << `defaults read #{thing}`.to_s | |
p default | |
File.open('defaults.txt', 'a+') { |f| f.write(default) } | |
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
#!/usr/bin/env ruby | |
require 'json' | |
require 'digest' | |
require 'tempfile' | |
if File.directory?(File.expand_path(ARGV[0])) | |
@base_dir = File.expand_path(ARGV[0]) | |
else | |
@base_dir = ENV['HOME'] | |
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
require 'listen' | |
path1 = File.join(ENV['home'], ".ruth") | |
path2 = File.join(ENV['home'], "foo") | |
hrm = Proc.new do |modified, added, removed| | |
p removed.inspect | |
end | |
listener = Listen.to(path2) |
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
srand(1) | |
=> 42920506317323317837762064960942154151 # This is the previous value of srand | |
3.times { puts "-> #{a.sample}"} | |
-> k | |
-> s | |
-> a | |
srand(2) | |
=> 1 # This is the previous value of srand | |
3.times { puts "-> #{a.sample}"} | |
-> l |
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
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
</body> | |
</html> | |
<script type="text/javascript"> | |
var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); |
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
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<meta charset="utf-8"> | |
<link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'> | |
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'> | |
<title>CW Player</title> | |
<script src="./scripts/jquery-2.2.0.min.js"> </script> | |
<style> | |
/*resets*/ |
OlderNewer