Skip to content

Instantly share code, notes, and snippets.

View ahawkins's full-sized avatar
💭
🌈🏄🏼‍♂️🤙🏻

Adam Hawkins ahawkins

💭
🌈🏄🏼‍♂️🤙🏻
View GitHub Profile
{"legacy_bump_up_voucher_ids":[2598,2599,2600,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2618,2619,2620,2621,2622,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2698,2699,2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,2726,2727,2728,2729,2730,2731,2732,2733,2734,2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,2751,2752,2753,2754,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,2766,2767,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,2780,2781,2782,2783,2784,2785,2786,2787,2788,2789,2790,2791,2792,2793,2794,2795,2796,2797,2798,2799,2800,2801,2802,2803,2804,2805,2806,2807,2839,2840,2841,2842,2843,2844,2845,2846,2847,2848,2861,2862,2863,2864,2865,2866,2867,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,290
import std.net.curl, std.stdio, std.parallelism, std.datetime, std.json, std.conv;
import std.array, std.range;
import std.getopt;
import std.algorithm;
import serp_request;
unittest {
auto testRun = TestRun();
# Failsafe operation mode
#
# Instantiate the cache with a block. Conditionally store the correct value
# only if the operation succeeds. Future calls to get must provided a fallback
# block, or they will recieve an error
cache = SimpleCache.new expires: 4.hours do |store, from, to|
begin
# Don't referesh cache if my_thing fails. An existing previous value
# will not be overwritten. Future calls must provide a fallback.
hawk@erde letters]$ make site
docker run \
--rm \
-v /home/hawk/projects/letters/tmp:/data \
-t ahawkins/letters \
bundle exec jekyll build --destination /data
/usr/local/lib/ruby/gems/2.1.0/gems/execjs-2.2.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /usr/local/lib/ruby/gems/2.1.0/gems/execjs-2.2.0/lib/execjs.rb:5:in `<module:ExecJS>'
from /usr/local/lib/ruby/gems/2.1.0/gems/execjs-2.2.0/lib/execjs.rb:4:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.1.0/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
5/18/14 6:23:57.592 PM Tweetbot[1565]: Exception detected while handling key input.
5/18/14 6:23:57.593 PM Tweetbot[1565]: *** NSRunStorage, _NSBlockNumberForIndex(): index (1) beyond array bounds (1)
5/18/14 6:23:57.595 PM Tweetbot[1565]: (
0 CoreFoundation 0x00007fff8614325c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff8e9bee75 objc_exception_throw + 43
2 CoreFoundation 0x00007fff8614310c +[NSException raise:format:] + 204
3 AppKit 0x00007fff8d4da797 _NSBlockNumberForIndex + 85
4 AppKit 0x00007fff8d4dd3f1 -[NSLayoutManager textContainerForGlyphAtIndex:effectiveRange:] + 274
5 AppKit 0x00007fff8d65f71c -[NSTextView drawsVerticallyForCharacterAtIndex:] + 198
6 AppKit 0x00007fff8d65f63e -[NSTextInputContext drawsVerticallyForCharacterAtIndex:] + 41
App.CiruitSwitchComponent = Ember.Component.extend({
isLocked: true,
lockText: (function() {
return(this.get('isLocked') === true ? 'Unlock' : 'Lock');
}).property('isLocked')
});
class PostRepo
extend Chassis::Repo::Delegation
class << self
def backend
PostStore.instance
end
end
end
class MemoryRepo < Chassis:MemoryRepo
def find(klass, id)
super klass, id.to_i
end
def query_auth_token_with_code(klass, q)
all(klass).find do |auth_token|
auth_token.code == q.code
end
end
class User
include Chassis::Persistence
attr_accessor :name, :phone_number, :token, :device
def push?
!!device.push_token
end
def save