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
package main | |
import ( | |
"fmt" | |
"github.com/crowdmob/goamz/aws" | |
"github.com/crowdmob/goamz/dynamodb" | |
"log" | |
"os" | |
"time" | |
) |
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 'aws-sdk' | |
require 'pry-byebug' | |
class MobyEvent | |
SCAN_WORKERS = 4 | |
class << self | |
def client | |
@dynamodb ||= Aws::DynamoDB::Client.new( | |
region: 'us-east-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
# lib/liquid_i18n_rails.rb | |
module LiquidI18nRails | |
def t(string) | |
I18n.t(string.to_sym) | |
end | |
end | |
# config/initializers/liquid.rb | |
require 'liquid_i18n_rails' | |
Liquid::Template.register_filter LiquidI18nRails |
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
# lib/liquid_i18n_rails.rb | |
module LiquidI18nRails | |
def t(string) | |
I18n.t(string.to_sym) | |
end | |
end | |
# config/initializers/liquid.rb | |
require 'liquid_i18n_rails' | |
Liquid::Template.register_filter LiquidI18nRails |
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
response.status = 200; | |
var payload = JSON.parse(request.body); | |
response.headers['Content-Type'] = 'application/json'; | |
response.body = { "request_id": payload.request_id, "summary": "Hello " + payload['order']['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
#!/bin/sh | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' | |
green='\033[0;32m' |
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
module Wombat | |
# @example Lock while executing `do_something` or expire in 10 seconds | |
# Wombat::Mutex.exclusive 'my_key', 10 do | |
# do_something | |
# end | |
# | |
class Mutex | |
class << self | |
# @param key [String] the lock key | |
# @param ttl [Fixnum] time to live in seconds |
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
# Lock while executing `do_something` or expire in 10 seconds | |
Wombat::Mutex.exclusive 'my_key', 10 do | |
do_something | |
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
{ | |
"title": "Email Schema", | |
"type": "object", | |
"required": [ | |
"to", | |
"sender_email", | |
"template" | |
], | |
"properties": { | |
"sender_email": { |
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 | |
msg_file = ARGV[0] | |
commit_msg = File.read(msg_file).to_s.strip | |
def empty_commit?(commit_msg) | |
return true if commit_msg.empty? | |
commit_msg.split("\n").each do |line| | |
# Lines starting with '#' will be ignored |