Skip to content

Instantly share code, notes, and snippets.

View kookster's full-sized avatar
🏠
Working from home

Andrew Kuklewicz kookster

🏠
Working from home
View GitHub Profile
# make this class in lib/transactional_requests.rb, and load it on start
require 'activerecord'
class TransactionalRequests
def initialize(app)
@app = app
end
def call(env)
ActiveRecord::Base.transaction do
@kookster
kookster / test.php
Created December 1, 2012 10:02
Test code for new matter.vc carousel
<?php
// ***** N.B. this get_bloginfo function is a stub for testing, deleted from production site code.
function get_bloginfo($key) {
return 'http://matter.vc/wp-content/themes/matter';
}
/*
matter_story_carousel() generates the html for the slides in the carousel.
/var/www/domains/publicradioplayer.org/beta.billboard/shared/bundle/ruby/2.0.0/gems/nokogiri-1.6.0.rc1/lib/nokogiri/xml/node.rb:151: [BUG] Segmentation fault
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0048 p:---- s:0224 e:000223 CFUNC :new
c:0047 p:0014 s:0220 e:000219 BLOCK /var/www/domains/publicradioplayer.org/beta.billboard/shared/bundle/ruby/2.0.0/gems/nokogiri-1.6.0.rc1/lib/nokogiri/xml/node.rb [FINISH]
c:0046 p:---- s:0216 e:000215 CFUNC :map
c:0045 p:0050 s:0213 e:000212 METHOD /var/www/domains/publicradioplayer.org/beta.billboard/shared/bundle/ruby/2.0.0/gems/nokogiri-1.6.0.rc1/lib/nokogiri/xml/node.rb
c:0044 p:0146 s:0205 e:000204 METHOD /var/www/domains/publicradioplayer.org/beta.billboard/shared/bundle/ruby/2.0.0/gems/nokogiri-1.6.0.rc1/lib/nokogiri/html/docume [FINISH]
c:0043 p:---- s:0195 e:000194 CFUNC :new
@kookster
kookster / test_travis_passing.svg
Created May 26, 2013 14:39
My latest, not cleaned up at all, version of the svg I am using to generate shields/badges.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kookster
kookster / gist:5928696
Created July 4, 2013 15:39
heroku staging sidekiq error
2013-07-04T15:35:35.244160+00:00 app[web.1]: Started POST "/api/items/1464/audio_files/2887" for 23.20.159.164 at 2013-07-04 15:35:35 +0000
2013-07-04T15:35:35.250328+00:00 app[web.1]: Processing by Api::V1::AudioFilesController#update as JSON
2013-07-04T15:35:35.250424+00:00 app[web.1]: Parameters: {"task"=>{"call_back"=>"http://pop-up-archive-staging.herokuapp.com/api/items/1464/audio_files/2887", "id"=>32189, "label"=>"91", "options"=>{"language"=>"en-US", "chunk_duration"=>5, "overlap"=>1, "max_results"=>1, "profanity_filter"=>true}, "result"=>"s3://staging.popuparchive.prx.org/5-hive-trim-wav.GiXafQ.popuparchive.org/hive_trim.wav_ts_start.json?x-fixer-metadata%5Bx-archive-meta-mediatype%5D=data", "task_type"=>"transcribe", "result_details"=>{"status"=>"complete", "message"=>"transcribe audio complete", "info"=>{"average_confidence"=>0.88154636125, "word_count"=>169, "character_count"=>888}, "logged_at"=>"2013-07-04T15:35:33Z"}}, "item_id"=>"1464", "audio_file_id"=>"2887", "audio_file"=>{}}
2013-07-04T1

Keybase proof

I hereby claim:

  • I am kookster on github.
  • I am kookster (https://keybase.io/kookster) on keybase.
  • I have a public key whose fingerprint is A816 261D BD42 DF64 A028 6BA8 7996 2F47 9ABA 38C9

To claim this, I am signing this object:

puts "---Starting run---"
threads = []
@mutex = Mutex.new
thread1_ids = []
thread2_ids = []
o = nil
a = nil
@kookster
kookster / angular-dnd.js
Created October 22, 2014 19:10
angular-dnd.js
(function (undefined) {
// https://github.com/angular/angular.js/blob/ed3f799b5c43f36cd162f3cdcdbdb43c33abde07/src/ngAria/aria.js#L84-L88
var camelCase = function (input) {
return input.replace(/-./g, function(letter, pos) {
return letter[1].toUpperCase();
});
};
// taken from angular compile.js
@kookster
kookster / gist:f47de036e3be5a5c4874
Last active August 29, 2015 14:15
Public Media On Github
# actual public radio stations
https://github.com/nypublicradio
https://github.com/KQED
https://github.com/SCPR
https://github.com/stlpublicradio
https://github.com/thebirn
https://github.com/michiganradio
https://github.com/kuscinteractive
https://github.com/klruweb
https://github.com/KPBS
CODE = %w(01010111 01101111 01110111 00101110 00100000 01011001 01101111 01110101 00100000 01101000 01100001 01110110 01100101 00100000 01010111 01000001 01011001 00100000 01110100 01101111 01101111 00100000 01101101 01110101 01100011 01101000 00100000 01110100 01101001 01101101 01100101 00100000 01101111 01101110 00100000 01111001 01101111 01110101 01110010 00100000 01101000 01100001 01101110 01100100 01110011 00100001)
solution = [CODE.join].pack('B*')
puts "\n\n---+++=== decode robosauce secret ===+++---\n\n"
puts "secret:\n#{CODE.join(' ')}\n\n"
puts "solution:\n'#{solution}'\n\n"