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 File.expand_path(File.dirname(__FILE__) + '/spec_helper') | |
describe 'Machinist' do | |
models = Dir[File.expand_path(File.dirname(__FILE__) + '/../app/models/*.rb')]. | |
map{|file| File.basename(file, '.rb') } - %w{mailer} | |
models.map{ |model| model.classify.constantize }.each do |model| | |
it "should have a blueprint for the #{model} model" do | |
model.make.should be_instance_of(model) | |
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
# java resource bundles initializer | |
if defined?(JRUBY_VERSION) | |
# include config directory in the class path | |
$CLASSPATH << "file:///#{File.expand_path(File.join(RAILS_ROOT, 'config'))}/" | |
# because ResourceBundle.getBundle doesn't seem to use the JRuby class loader, | |
# we need to pass it explicitly. | |
def load_resource_bundle(basename, lang = java.util.Locale::ENGLISH) |
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
resource_path_name = Rails.root + 'config' + 'properties.xml' | |
resource_properties = java.util.Properties.new | |
resource_properties.load_from_xml(java.io.FileInputStream.new(resource_path_name.to_s)) | |
# resource_properties['my.key'] # => 'value' | |
resource_properties.store_to_xml(java.io.FileOutputStream.new(resource_path_name.to_s), 'jruby rulez') |
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
#pdf_link a:after { | |
content: "<" attr(href) ">"; | |
} |
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 'observer' | |
class Iraci < Struct.new(:name, :birth_date) | |
include Observable | |
def birth! | |
self[:birth_date] = Time.now.strftime('%d %B') | |
changed | |
notify_observers(name, birth_date) | |
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
# Simple BASH function that shortens | |
# a very long path for display by removing | |
# the left most parts and replacing them | |
# with a leading ... | |
# | |
# the first argument is the path | |
# | |
# the second argument is the maximum allowed | |
# length including the '/'s and ... | |
# |
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 'formula' | |
class GstPluginsGl < Formula | |
url 'http://www.gstreamer.net/src/gst-plugins-gl/gst-plugins-gl-0.10.1.tar.gz' | |
homepage 'http://www.gstreamer.net/src/gst-plugins-gl/' | |
md5 '81c098243702c0f22db1527d0077d7bf' | |
def install | |
system "./configure", "--prefix=#{prefix}" | |
system "make install" |
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
$ GST_DEBUG=*:2 gst-launch videotestsrc ! glimagesink | |
Setting pipeline to PAUSED ... | |
Pipeline is PREROLLING ... | |
Caught SIGSEGV accessing address 0x79 | |
#0 0x00007fff82b6adce in select$DARWIN_EXTSN () | |
#1 0x0000000100197e92 in g_poll () | |
#2 0x0000000100187bed in g_main_context_iterate () | |
#3 0x0000000100187fb5 in g_main_loop_run () | |
#4 0x0000000100019700 in gst_bus_poll () | |
#5 0x0000000100001acb in dyld_stub_g_str_has_prefix () |
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 compush { | |
MSG="update" | |
if [ "$1" = "-m" ] ; then | |
MSG="$2" | |
shift | |
shift | |
fi | |
FLAGS="" | |
if [ "$#" = 0 ] ; then |
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
STRFTIME(3) BSD Library Functions Manual STRFTIME(3) | |
NAME | |
strftime, strftime_l -- format date and time | |
The conversion specifications are copied to the buffer after expansion as | |
follows: | |
%A is replaced by national representation of the full weekday name. |