Skip to content

Instantly share code, notes, and snippets.

@anselmo
anselmo / metrics-template.json
Created July 23, 2016 13:34 — forked from tegud/metrics-template.json
Template for using Elasticsearch as a Time Series Database
{
"metrics" : {
"order" : 0,
"template" : "metrics-*",
"settings" : {
"index" : {
"refresh_interval" : "5s"
}
},
"mappings" : {
@anselmo
anselmo / elasticsearch-cheatsheet.txt
Created July 15, 2016 17:53 — forked from stephen-puiszis/elasticsearch-cheatsheet.txt
Elasticsearch Cheatsheet - An Overview of Commonly Used Elasticsearch API Endpoints and What They Do
# Elasticsearch Cheatsheet - an overview of commonly used Elasticsearch API commands
# cat paths
/_cat/allocation
/_cat/shards
/_cat/shards/{index}
/_cat/master
/_cat/nodes
/_cat/indices
/_cat/indices/{index}
@anselmo
anselmo / bootstrap.sh
Created July 13, 2016 20:43 — forked from gblmarquez/bootstrap.sh
mac bootstrap
brew cask install google-chrome
brew cask install firefox
brew cask install skype
brew cask install spotify
brew cask install iterm2
brew cask install atom
brew cask install virtualbox --appdir=/Applications
brew install azukiapp/azk/azk
@anselmo
anselmo / gist:d679ab46ffb9353709ef365ecc0cef74
Created May 30, 2016 23:09 — forked from cb372/gist:1d7b1abbbf0c643f2903
Using Elasticsearch as a Spark data source

Install the essentials.

$ brew update && brew install elasticsearch && brew install apache-spark

Start ES.

$ elasticsearch

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/q.js/1.0.1/q.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@anselmo
anselmo / gist:5930858
Last active December 19, 2015 09:09
.vimrc - quick vim config
filetype on
filetype off
filetype plugin indent on
set nocompatible
set encoding=utf-8
set modelines=0
set scrolloff=3
set autoindent
set showmode
set showcmd