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
Loading development environment (Rails 2.3.2) | |
>> root = Rails.root | |
=> #<Pathname:/Users/seth/diversion/hdcloud> | |
>> root + "/test" | |
=> #<Pathname:/test> | |
>> wtf | |
NameError: undefined local variable or method `wtf' |
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
Shoes.app do | |
slot_to_update = stack do | |
para "hi!" | |
end | |
button "go bye bye" do | |
slot_to_update.clear do | |
para "bye!" | |
end | |
end |
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/local/bin/ruby | |
require 'rubygems' | |
require 'grit' | |
require 'choice' | |
Choice.options do | |
header 'Use one of the following options:' | |
option :new do |
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 ginit { | |
mkdir $1 | |
cd $1 | |
git init | |
} |
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
mysql> explain SELECT * FROM `jobs` WHERE (`jobs`.`user_id` = 5) AND ((`jobs`.`published` = 0) AND (`jobs`.`job_type` = 'encode')) ORDER BY priority desc, created_at asc LIMIT 1; | |
+----+-------------+-------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------+---------+-------------------+------+-----------------------------+ | |
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | | |
+----+-------------+-------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------+---------+-------------------+------+--------------------- |
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
named_scope :created_within_range, proc { |range| | |
if range and [:min, :max].all? { |a| range.respond_to? a } | |
{ :conditions => ["created_at > ? and created_at < ?", range.min, range.max] } | |
else | |
{ } | |
end | |
} |
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
# I've been reading a book on symmetry lately(http://is.gd/MGST), | |
# and the other day it touched on something interesting that it | |
# turns out my code could have benefited from very recently: | |
# Modular Arithmetic | |
# The use case was cycling through indexes of an array. | |
# I had an operation that I wanted cycle through an array of values | |
# for use each time it was run. | |
# Instead of something like this... |
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/local/bin/ruby | |
file = ARGV[0] | |
info = ARGV[1] ? "@#{ARGV[1]}" : "@info" | |
property = /^ | |
([^:]+): # name | |
(.+?) # value | |
$/x |
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
$ mediainfo test/videos/magnify-3_5_TOMD_-_Dave_L.mp4 | |
General | |
Complete name : test/videos/magnify-3_5_TOMD_-_Dave_L.mp4 | |
Format : MPEG-4 | |
Format profile : Base Media / Version 2 | |
Codec ID : mp42 | |
File size : 11.1 MiB | |
Duration : 2mn 28s | |
Overall bit rate : 627 Kbps | |
Encoded date : UTC 2009-03-06 17:15:04 |
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
ffmpeg -i test/videos/magnify-3_16_Wow_outfit_day.mp4 | |
FFmpeg version SVN-r17587, Copyright (c) 2000-2009 Fabrice Bellard, et al. | |
configuration: --prefix=/usr/local --disable-vhook --enable-pthreads --enable-shared --enable-gpl --enable-libmp3lame --enable-libfaac --enable-libfaad --enable-libx264 --enable-nonfree --enable-libamr-nb --enable-libamr-wb | |
libavutil 49.15. 0 / 49.15. 0 | |
libavcodec 52.19. 0 / 52.19. 0 | |
libavformat 52.30. 0 / 52.30. 0 | |
libavdevice 52. 1. 0 / 52. 1. 0 | |
built on Feb 25 2009 11:43:00, gcc: 4.0.1 (Apple Inc. build 5490) | |
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test/videos/magnify-3_16_Wow_outfit_day.mp4': | |
Duration: 00:02:16.23, start: 0.000000, bitrate: 1436 kb/s |