Skip to content

Instantly share code, notes, and snippets.

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

Josep Servat servatj

🏠
Working from home
View GitHub Profile
INFURA_URL_TESTNET=<your_url_and_key>
@Geoff-Ford
Geoff-Ford / master-javascript-interview.md
Last active May 2, 2024 13:13
Eric Elliott's Master the JavaScript Interview Series
/*
Búsqueda binaria (Binary Search): Implementación de ejemplo.
Recibe un array ordenado y el elemento a buscar. Si encuentra el elemento
devolverá el índice del elemento encontrado, si no se encuentra devolverá `-1`.
*/
function binarySearch(array, item) {
@dannycoates
dannycoates / etl.md
Last active July 22, 2019 12:40
AWS Lambda for ETL

Experimenting with AWS Lambda for ETL

A lot of us are interested in doing more analysis with our service logs so I thought I'd share an experiment I'm doing with Sync. The main idea is to transform the raw logs into something that'll be nice to query and generate reports with in Redshift.

The Pipeline

Pipeline Diagram

Logs make their way into an S3 bucket (lets call it the 'raw' bucket) where we've got a lambda listening for new data. This lambda reads the raw heka protobuf gzipped data, does some transformation and writes a new file to a different S3 bucket (the 'processed' bucket) in a format that is redshift friendly (like json or csv). There's another lambda listening on the processed bucket that loads this data into Redshift.

@squarism
squarism / iterm2.md
Last active May 19, 2024 21:32
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@knzconnor
knzconnor / 1_intro_to_subject.rb
Created February 8, 2011 07:45
A pattern for testing class methods in ruby with rspec explicit subjects
# RSpec's subject method, both implicitly and explicitly set, is useful for
# declaratively setting up the context of the object under test. If you provide a
# class for your describe block, subject will implicitly be set to a new instance
# of this class (with no arguments passed to the constructor). If you want
# something more complex done, such as setting arguments, you can use the
# explicit subject setter, which takes a block.
describe Person do
context "born 19 years ago" do
subject { Person.new(:birthdate => 19.years.ago }
it { should be_eligible_to_vote }