Skip to content

Instantly share code, notes, and snippets.

View fabioyamate's full-sized avatar

Fabio Yamate fabioyamate

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

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 March 11, 2024 11:27
Channels Are Not Enough or Why Pipelining Is Not That Easy
@kachayev
kachayev / css-parser.md
Last active November 12, 2022 04:20
Parsing CSS file with monadic parser in Clojure
(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 November 22, 2013 13:02
A simple lib to create popup/tooltips
(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 October 30, 2013 11:07
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 …
(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 December 26, 2015 00:38
Apache2 assets config
# 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
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 April 22, 2013 23:52
transliterate string given a table conversion
// 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 December 15, 2015 20:09
Mediator pattern for event stream with context bind.
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"