This is a Go script that can be deployed to AWS Lambda and returns the caller's IP address formatted in JSON.
This file contains hidden or 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 ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"os" |
This file contains hidden or 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 bash | |
export PROTEST_REPORT=summary | |
export PROTEST_FAIL_EARLY=true | |
find_command() { | |
find ./test -name "*.rb" -mindepth 2 | |
} | |
NUMBER_OF_FILES=$(echo `find_command | wc -l`) |
This file contains hidden or 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 Randomizer | |
PATTERNS = { | |
lowercase: Array("a".."z"), | |
uppercase: Array("A".."Z"), | |
numbers: Array(0..9), | |
special: %w(- _ .) | |
} | |
module_function | |
def configure(options) |
I hereby claim:
- I am fsaravia on github.
- I am fedesaravia (https://keybase.io/fedesaravia) on keybase.
- I have a public key whose fingerprint is 17AC 1D9C 4AC2 F27B 4833 9C85 1418 10C1 2437 B1FD
To claim this, I am signing this object:
This file contains hidden or 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
ENV['CPUPROFILE_REALTIME'] = 1 | |
require 'perftools' | |
require 'rspec' | |
dirs = [] | |
dirs.concat Dir["./spec/models/*.rb"] | |
dirs.concat Dir["./spec/routes/*.rb"] | |
dirs.concat Dir["./spec/helpers/*.rb"] | |
dirs.concat Dir["./spec/script/*.rb"] |
This file contains hidden or 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 ZonedTimes | |
@@zoned_methods = [] | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
module ClassMethods |
This file contains hidden or 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
# ActiveRecord edition | |
# For use with DataMapper replace line 7 with the following line | |
# if model.first(property.to_sym => result).nil? | |
def fake_unique(model, property, method_module, method) | |
result = method_module.send(method.to_sym) | |
if model.where(property.to_sym => result).first.nil? | |
result | |
else | |
fake_unique(model, property, method_module, method) |