Skip to content

Instantly share code, notes, and snippets.

View sleepiecappy's full-sized avatar

Evangelista sleepiecappy

View GitHub Profile
@sleepiecappy
sleepiecappy / rake task
Created July 4, 2016 00:35 — forked from mcansky/rake task
simple ruby git changelog generator
# simple rake task to output a changelog between two commits, tags ...
# output is formatted simply, commits are grouped under each author name
#
desc "generate changelog with nice clean output"
task :changelog, :since_c, :until_c do |t,args|
since_c = args[:since_c] || `git tag | head -1`.chomp
until_c = args[:until_c]
cmd=`git log --pretty='format:%ci::%an <%ae>::%s::%H' #{since_c}..#{until_c}`
entries = Hash.new
@sleepiecappy
sleepiecappy / introrx.md
Created August 3, 2016 19:11 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@sleepiecappy
sleepiecappy / gh-pages-deploy.md
Created August 17, 2016 17:23 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@sleepiecappy
sleepiecappy / download_hex_docs.sh
Created September 18, 2016 18:50 — forked from seven1m/download_hex_docs.sh
Download the docs for a project from hexdocs.pm
#!/bin/bash
project=$1
wget --mirror -k -np http://hexdocs.pm/$project
ruby -e "puts ARGF.read.scan(/[A-Z]\\w*\\.[\\w\\.]+/).uniq.map { |l| 'http://hexdocs.pm/$project/' + l + '.html' }" hexdocs.pm/$project/dist/sidebar_items.js | wget --mirror -k -i -
wget --mirror -k http://hexdocs.pm/$project/extra-api-reference.html
@sleepiecappy
sleepiecappy / material_design_guidelines_dimens.xml
Created May 22, 2017 21:03 — forked from aeroechelon/material_design_guidelines_dimens.xml
Recommended Material Design Dimensions for Android
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
# Material Design Dimensions
These dimensions are provided as per Material Design Guidelines
to adhere to a 8 dp baseline grid. (With the exception of the
toolbar and notification bar.).
## References
@sleepiecappy
sleepiecappy / .editorconfig
Created March 11, 2018 14:32 — forked from eksperimental/.editorconfig
.editorconfig for Elixir projects
# EditorConfig is awesome: http://EditorConfig.org
# .editorconfig for Elixir projects
# https://git.io/elixir-editorconfig
# top-most EditorConfig file
root = true
[*]
indent_style = space
@sleepiecappy
sleepiecappy / observer.md
Created October 24, 2018 03:18 — forked from pnc/observer.md
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
import akka.actor.ActorRef;
import akka.dispatch.*;
import org.jctools.queues.MpscArrayQueue;
/**
* Non-blocking, multiple producer, single consumer high performance bounded message queue,
* this implementation is similar but simpler than LMAX disruptor.
*/
public final class MpscBoundedMailbox implements MessageQueue {
@sleepiecappy
sleepiecappy / pure-impure.md
Last active February 25, 2019 19:17 — forked from tomekowal/pure-impure.md
Pure vs impure

Pure vs impure and why should I care?

Some of the most important advancements in programming came from adding restrictions to the way we program. Famous article by Edsger Dijkstra Go To Statement Considered Harmful shows how introducing one statement into programming language breaks many nice properties of that language. goto gives us freedom and solves couple of simple problems like breaking from nested loops easily, but it can make programs very hard to understand. This happens, because we cannot look at two pieces of code in separation. The execution can jump to some other place in code or even worse: it can jump from other piece of code to here and We need to keep that in mind.

@sleepiecappy
sleepiecappy / gist:da2a7a613e62f3f4372b5590d6a4485f
Created June 1, 2019 04:30 — forked from pbailis/gist:5660980
Assorted distributed database readings

Context: I was asked for a list of interesting reading relating to "distributed databases, behavior under partitions and failures, failure detection." Here's what I came up with in about an hour.

For textbooks, "Introduction to Reliable and Secure Distributed Programming" is a superb introduction to distributed computing from a formal perspective; it's really not about "programming" or "engineering" but about distributed system fundamentals like consensus, distributed registers, and broadcast. Used in Berkeley's Distributed Computing course (and HT to @lalithsuresh) Book Site

Notes from courses like Lorenzo Alvisi's Distributed Computing class can be great.

There are a bunch of classics on causality, [Paxos](ht