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 "fileutils" | |
search_term = ARGV[0] | |
if search_term | |
time = Time.now | |
directory_path = File.dirname(__FILE__) + "/tweets/" + search_term + "_" + time.to_i.to_s | |
FileUtils.mkdir_p(directory_path) | |
directory = Dir.new(directory_path) | |
(1..15).each do |i| | |
`curl "http://search.twitter.com/search.json?q=#{search_term}&rpp=100&page=#{i}&include_entities=true&result_type=mixed" > #{directory.path}/#{i}.json` |
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
Options: (options marked with * are required) | |
-h, --help display this usage message | |
* --prefix <filename> output filename prefix | |
--clip <name> clip (MaterialPackage) name. | |
--project <name> Avid project name. | |
--tape <name> tape name. | |
--ntsc NTSC framerate and frame size. Default is DV file frame rate or PAL | |
--film24 use framerate of 24 instead of default 25fps | |
--film23.976 use framerate of 23.976 (24000/1001) instead of default 25fps | |
--legacy use legacy DataDefs, for DV essence use legacy descriptor properties |
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
# Enables support for Compass, a stylesheet authoring framework based on SASS. | |
# See http://compass-style.org/ for more details. | |
# Store Compass/SASS files (by default) within 'app/stylesheets' | |
module CompassInitializer | |
def self.registered(app) | |
require 'sass/plugin/rack' | |
Compass.configuration do |config| | |
config.project_path = Padrino.root |
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
#untested - does this work? | |
module DataMapper | |
class Transaction | |
module DataObjectsAdapter | |
def nested_transaction_primitive | |
DataObjects::SavePoint.create_for_uri(normalized_uri, current_connection) | |
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
mediainfo -f /files/timecode/528006c9-33b0-4a89-9b94-c9bf7f6be2a9.mov | grep '^Delay.*: [0-9][0-9]:' | awk '{split($0,a,": "); print a[2]}' |
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
get %r{(.+)/$} do |r| redirect r; 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
# Deal with the usual JSON gem idiocy. Guys, come on. I want to serialize an integer, surely this can't be that hard | |
class Fixnum | |
def to_json(options = nil) | |
to_s | |
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
<cnpsXML StartTimeCode="00:00:05;00"> <Markers> | |
<Marker_1 MarkerTime_27MHz.QWD="270000000" MarkerName="Marker1"/> | |
<Marker_2 MarkerTime_27MHz.QWD="540000000" MarkerName="Marker2"/> | |
<MyMarker MarkerTime_27MHz.QWD="810000000" MarkerName="MyMarker"/> | |
</Markers> </cnpsXML> |
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
If you do this: | |
(205.00).floor | |
You would expect 205. | |
Likewise with: | |
(2.05*100).floor |
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
Here are the commands I used to create http://royalcourt.heroku.com | |
(Assuming ruby, rubygems, heroku, git) | |
sudo gem install caboodle | |
caboodle create royalcourt | |
cd royalcourt | |
caboodle kit:add flickr | |
(input flickr username) | |
caboodle kit:add twitter |