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 | |
system("sudo modprobe -r v4l2loopback") | |
system("pkill gphoto") | |
system("sudo modprobe v4l2loopback exclusive_caps=1 max_buffers=2") | |
system("gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0") |
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
# place in ~/.gitignore | |
# configure with `git config --global core.excludesfile ~/.gitignore` | |
!/log/.keep | |
!/storage/.keep | |
!/tmp/.keep | |
.byebug_history | |
.env | |
.envrc | |
.rspec | |
.rvmrc |
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
$('form').submit (event) -> | |
$(this).find('.datetime').each -> | |
$(this).val moment(new Date($(this).val())) |
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 regex parses attributes from their values such as those in HTML elements. It returns the attribute | |
names and their values even when the quotes are escaped, nested, or omitted. | |
The following are examples attribute/value pairs that are properly divided: | |
a="a" b="b b" c='c' d=1 e="escaped \" quotes" f="'nested quotes'" g = 'gaps' h="multiple spaces" | |
The attribute name will be in match position 0, while the value will be in either position 4 or 5 | |
depending on whether or not the value is quoted. |
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
webuser@cms-site:~/cmshome/current$ bundle exec rake production db:bootstrap | |
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. | |
Gem.source_index called from /home/webuser/cmshome/shared/bundle/ruby/1.9.1/gems/rails-2.3.14/lib/rails/gem_dependency.rb:21. | |
This task will destroy any data in the database. Are you sure you want to | |
continue? [yn] y | |
-- drop_table("schema_migrations") | |
-> 0.0354s | |
-- drop_table("config") | |
-> 0.0029s |
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 'spec_helper' | |
describe Article do | |
it 'can set the privacy' do | |
article = create(:article) | |
article.comments.first.privacy.should eq 'low' #Pass | |
comment = article.comments.first | |
comment.privacy.should eq 'low' #Pass |
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
<script type="text/javascript"> | |
window.onload = function(){ setTimeout(function() { window.scrollTo(0,0); },500); }; | |
window.onorientationchange = function(){ setTimeout( function() { window.scrollTo(0,0); },100); }; | |
function load() { if (navigator.userAgent.match(/OS 5(_\d)+ like Mac OS X/i)) { document.body.className+=" ios5" }} | |
</script> |
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 'simplecov' | |
SimpleCov.start | |
require 'rubygems' | |
require 'spork' | |
Spork.prefork do | |
# This file is copied to spec/ when you run 'rails generate rspec:install' | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) |