Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Synchronously | |
class Fetcher | |
def self.fetch_api_data(uuids) | |
uuids.map { |uuid| new(uuid).fetch } | |
end | |
def fetch | |
"api response for #{uuid}" | |
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
MyModule = Module.new | |
MyModule.module_eval do | |
@module_ivar = 4 | |
class << self | |
def my_singleton_method | |
@module_ivar | |
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
## Run rake rebuild | |
# | |
#task :rebuild do | |
# DiscogsServer.shutdown | |
# | |
# DiscogsServer.delete_disks | |
# | |
# DiscogsServer.delete_configs | |
# | |
# DiscogsServer.create_disks |
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
# Please rewrite the MyString definition, without using ruby keywords | |
# http://www.ruby-doc.org/docs/keywords/1.9/ | |
class MyString < String | |
class << self | |
def alphabet | |
'abc' | |
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
Object.send(:define_method, :eigen, lambda{ class << self; self; end }) #crack open the eigenclass |
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
ffmpeg -ss 00:40:00 -t 1200 -i E3-1080.mp4 -acodec copy -vcodec copy E3-3-1080.mp4 |
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
slow - ffmpeg -loop_input -shortest -y -i trevor_dale.jpg -i TrevorDale_Summer88.mp3 -acodec copy -vcodec mjpeg TrevorDale_Summer88.avi | |
fast - ffmpeg -f image2 -loop_input -i MichaelWatford_SoIntoYou\(DubMix\).jpg -i MichaelWatford_SoIntoYou\(DubMix\).mp3 -vcodec mpeg4 -qscale 2 -acodec copy -shortest MichaelWatford_SoIntoYou\(DubMix\)2.avi |
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
Dir.entries(".").each { |filename| if (filename =~ /\A[0-9]{3}-[a-zA-Z0-9]+-(.+)-small(.mp4)\Z/) then File.rename(filename, $1+$2) 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
cat changeset.xml | sed '/<cs:removal>/ { | |
N | |
s|<cs:removal>\n|<cs:removal>| | |
N | |
s|</rdf:Statement>\n|</rdf:Statement>| | |
}' | sed 's|<cs:removal>.*</cs:removal>||' > changeset_addition.xml |
NewerOlder