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 | |
require 'fileutils' | |
def analyze | |
Dir.glob("public/dist/**/*.{js,css}").reduce({}) do |hash, filename| | |
filename =~ /public\/dist\/([^-]*)(-.{10})?\.(.*)/ | |
name = "#{$1}.#{$3}" | |
# puts name | |
hash[name] = File.new(filename).size |
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
signups = cuco_session.course_signups.includes(:course_role, :course).where(person: family.people) | |
count = signups.where(person_id: person.id).joins(:course).where(courses: { period_id: period.id }).count | |
## | |
x = cuco_session.course_signups | |
y = x.includes(:course_role, :course) | |
signups = y.where(person: family.people) | |
a = signups.where(person_id: person.id) |
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
// What should we call the things under each day? | |
// Its kinda like a recurring event but not quite | |
// "WeeklyScheduleEventThingy"? We can do better! | |
// http://delorean/schedules?staff_member_uid=asdfasdfasfd | |
// create, update, index, show | |
{ | |
"schedule": { | |
"start_date": "2016-01-01", |
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
'use strict'; | |
describe('Offers : controller', function(){ | |
beforeEach(module('client')); | |
var $scope, | |
genericService; | |
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
"use strict"; | |
angular.module('gatewayApp') | |
.factory('Cache', [function(){ | |
var cache = {}; | |
var _get = function(key) { | |
var cacheHit = cache[key]; | |
if (_exists(cacheHit) && _notExpired(cacheHit)) { | |
return cacheHit.value; | |
} else { |
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
### Keybase proof | |
I hereby claim: | |
* I am alexrothenberg on github. | |
* I am alexrothenberg (https://keybase.io/alexrothenberg) on keybase. | |
* I have a public key whose fingerprint is BD37 11A2 4CA9 9DC3 FE1F 1F4B E978 24DB 3CDB 639F | |
To claim this, I am signing this object: |
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
alert('hi') |
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
Motion::Project::App.setup do |app| | |
app.info_plist['API_BASE_URL'] = ENV['API_BASE_URL'] || 'http://api.myserver.com' | |
end | |
task :cucumber => [:stub, :'build:simulator', :'calabash:run'] | |
task :stub do | |
ENV['API_BASE_URL'] = 'http://stub.example.com' | |
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
MRI - detect with a lambda complains about 2 parameters but map works | |
$ irb | |
2.1.1 :001 > lambda = ->(word, index) { word.length == 3 } | |
=> #<Proc:0x007fb52d00ab38@(irb):1 (lambda)> | |
2.1.1 :002 > %w(Hi there how are you).each_with_index.detect &lambda | |
ArgumentError: wrong number of arguments (1 for 2) | |
from (irb):1:in `block in irb_binding' | |
from (irb):2:in `each' | |
from (irb):2:in `each_with_index' |
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
-(void)someBigMethod { | |
// create a screenshot | |
CALayer * screenLayer = [[[[[UIApplication sharedApplication] keyWindow] rootViewController] view] layer]; | |
CGFloat const shotScale = ([[UIScreen mainScreen] scale] / 2.0); | |
UIGraphicsBeginImageContextWithOptions(screenLayer.bounds.size, YES, shotScale); | |
[screenLayer renderInContext:UIGraphicsGetCurrentContext()]; | |
UIImage * screenshot = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
// put the screenshot in a layer |
NewerOlder