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
# active_admin and formtastic seem kinda picky about displaying both the | |
# image and the file input together here... in fact, it seems like this | |
# is the ONLY way to do this? Adding anything else after the image_tag squashes it. | |
ActiveAdmin.register Film do | |
form do |f| | |
f.inputs "Film" do | |
f.input :title | |
end | |
f.has_many :stills do |film_still_form| |
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
# coding: utf-8 | |
require 'sinatra' | |
set server: 'thin', connections: [] | |
get '/' do | |
halt erb(:login) unless params[:user] | |
erb :chat, locals: { user: params[:user].gsub(/\W/, '') } | |
end | |
get '/stream', provides: 'text/event-stream' do |
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
node> if ([]) { console.log ("hey"); } | |
hey | |
node> [] == false | |
true | |
node> [] == true | |
false | |
node> if (false) { console.log("hey"); } |
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
class Photo < ActiveRecord::Base | |
mount_uploader :file, StillImageUploader | |
def dimensions(version = nil) | |
image ||= MiniMagick::Image.open(file.url(version)) | |
{width: image['width'], height: image['height']} | |
end | |
end | |
# photo.dimensions |
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
let g:NERDTreeMouseMode = 3 | |
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif |
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
loadHtml = (elem, url) -> | |
$.ajax | |
url: url | |
context: document.body | |
dataType: "html" | |
success: (data) -> | |
elem.html data |
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
*@workbridgeassociates.com OR *@vtrit.com OR *@jsgeeks.com OR *@questgroups.com OR *@identified.com OR *@sysdevit.com OR *@kbretz.com OR *@brightonsearchgroup.com OR *@trajectory.us.com OR *@peakrecruit.com OR *@turner.com OR *@surrex.com OR *@strategic-staffing.com OR *@encoress.com OR *@kforce.com OR *@epro-consulting.com OR *@resourcis.com OR *@bravotech.com OR *@aplussearch.com OR *@kutirtech.com OR *@thebackplane.com OR *@sptechpartners.com OR *@aimconsulting.com OR *@jobspringpartners.com OR *@axiustek.com OR *@lumoslabs.com OR *@rivierapartners.com OR *@omegasolutioninc.com OR *@good.com OR *@marlabs.com OR *@silversearchinc.com OR *@ownpointofsale.com OR *@talent4now.com OR *@githire.com OR *@linkedin.com OR *@clearslide.com OR *@xcreek.com OR *@disys.com OR *@jinibot.com OR *@avanitechsolutions.com |
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
#http://thehackerolympics.com/ | |
key = 'qwertyuiop' | |
string = 'iirytroyppytpeppowuiyoiuypipiyuyotyoiwiytorouqyiepyirueuiprpptwyiroqwtuyipourrrourorwipowiorutpwtwruuioquteorioriyutwqyyprptuqqquuituyywyuoewtrppqwrtiiruirpwyptpuoyyoeyerpqiotuieripurouwuwyuwrworowitoepoypeipeypiireeorrwripuuteoitpuutturruwiyryeetyrioweytueqrrrtotrpiqetoyepoipiwrwpppiritupwipruooiepoweypiuwrqywuuwyiroqpqpruioopuiuerputpwwuuiqwpiroewrtwiqerteoyeqtutwoeoipioiuqiiiouuoqtuuwtuwiiqwppqitywuqpuutrqiyoeuuutwrwtoqrqyoeyoiporuuioiwryoeruypreprqroiyuqwtuyoytoerwqryeeripryieypiwqirtriurueypiuyuypriuiwptywppupoioyrewooytreteeriiwroietuwypieeeeeqpiiiwrirtppoeyiwpooyyporpruwuoriiyowuytiwpwpryeywotoyirqypyypoeptiuwwoyprquoetepptorwiewprpiywwtuieeiweytrrwiqtwotioryoiptyyyuriiqiyroeeiqepwteuwptpruuypipieuoiiuuweeuryuuowporrooyywyyrryriqyirooitirueruptotpryoqtipippyptiurwyiryooywtryyuurtrutwqiqiiiqwouyeooueoturuowiuwrtruwwiupwopwweoo' | |
#split into unique pairs | |
array = string.scan(/../) | |
unique_pairs = array.keep_if {|letters| array.count(letters) == 1} |
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
Gem::Specification.new do |s| | |
s.name = 'stupid-watcher' | |
s.version = '0.0.2' | |
s.platform = Gem::Platform::RUBY | |
s.author = 'Robert Whitney' | |
s.email = '[email protected]' | |
s.summary = 'Stupid watcher is stupid' | |
s.description = 'Watches a file, does stuff when that file is updated.' | |
s.files = ['stupid_watcher.rb'] |
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
# rake deploy:production master | |
# List of environments and their heroku git remotes | |
ENVIRONMENTS = { | |
:staging => 'myapp-staging', | |
:production => 'myapp-production' | |
} | |
namespace :deploy do | |
ENVIRONMENTS.keys.each do |env| |