Skip to content

Instantly share code, notes, and snippets.

Avatar

Fabio Yamate fabioyamate

View GitHub Profile
@kevinelliott
kevinelliott / osx-10.11-setup.md
Last active Apr 10, 2022
Mac OS X 10.11 El Capitan Setup
View osx-10.11-setup.md

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

@kachayev
kachayev / concurrency-in-go.md
Last active Apr 10, 2022
Channels Are Not Enough or Why Pipelining Is Not That Easy
View concurrency-in-go.md
@kachayev
kachayev / css-parser.md
Last active Apr 2, 2021
Parsing CSS file with monadic parser in Clojure
View css-parser.md
View transducerfun.clj
(require '[clojure.core.async :as a])
(def xform (comp (map inc)
(filter even?)
(dedupe)
(flatmap range)
(partition-all 3)
(partition-by #(< (apply + %) 7))
(flatmap flatten)
(random-sample 1.0)
@fabioyamate
fabioyamate / overlay.js
Created Nov 22, 2013
A simple lib to create popup/tooltips
View overlay.js
(function(window, $) {
var containers = [];
// Public: position a container overlayed close to the target
//
// container - the container id
// callback - a function callback that receives 'container' and 'target'
//
// Examples
//
@gerritjvv
gerritjvv / core.async-lazy-sequence
Created Oct 30, 2013
This is for a situation where you have N amount of threads reading from different sources and want to consume all of the data they produce as a single sequence. Can be described as merging N queues from different sources and works well when the data produced is from IO. e.g. My usage is with kafka, I have multiple kafka topics and partitions to …
View core.async-lazy-sequence
(use 'clojure.core.async)
;this is the function you want to use
(defn lazy-channels [chs]
(lazy-seq (cons (let [ [v _] (alts!! chs)] v) (lazy-channels chs))))
;now for the tesging
(def chs [ (chan) (chan) (chan) ]) ; the channels can come from anywhere, here we are using three channels for testing
@fabioyamate
fabioyamate / apache.conf
Last active Dec 26, 2015
Apache2 assets config
View apache.conf
# a2enmod headers expires
SetEnv no-gzip
<LocationMatch "^/assets/.*\.(css|js)$">
RewriteEngine on
# Make sure the browser supports gzip encoding before we send it,
# and that we have a precompiled .gz version.
RewriteCond %{HTTP:Accept-Encoding} \b(x-)?gzip\b
View stock.bacon.js
var quotes = [{ symbol: 'MSFT', price: 27.01 },
{ symbol: 'INTC', price: 21.75 },
{ symbol: 'MSFT', price: 27.96 },
{ symbol: 'MSFT', price: 31.21 },
{ symbol: 'INTC', price: 22.54 },
{ symbol: 'INTC', price: 20.98 },
{ symbol: 'MSFT', price: 30.73 }]
function priceIncrease(w) {
return w[1].price / w[0].price - 1;
@fabioyamate
fabioyamate / transliterate.js
Created Apr 22, 2013
transliterate string given a table conversion
View transliterate.js
// transliterate (Char a) :: [a] -> [a] -> [a] -> [a]
var transliterate = function(from, to) {
var approximations = {};
for (var i = 0, len = from.length; i < len; ++i) {
approximations[from.charAt(i)] = to.charAt(i);
}
return function(input) {
return input.replace(/[^\x00-\x7f]/g, function(char) {
@fabioyamate
fabioyamate / example.js
Last active Dec 15, 2015
Mediator pattern for event stream with context bind.
View example.js
var person = { name: "John" };
window.name = "Paul";
mediator.on("call-people", function() {
console.log(this.name); // print "Paul"
});
mediator.on("call-people", function() {
console.log(this.name); // print "John"