Skip to content

Instantly share code, notes, and snippets.

View kevgathuku's full-sized avatar

Kevin Gathuku kevgathuku

View GitHub Profile
@mauvm
mauvm / Jasmine-and-Babel6.md
Created November 12, 2015 10:51
Jasmine ES6 run script for use with Babel 6
$ npm install --save babel-cli babel-preset-es2015
$ npm install --save-dev jasmine

.babelrc:

{
 "presets": ["es2015"]
@jakub-g
jakub-g / _1_"script async defer" blocks "load" event.md
Last active August 22, 2023 10:10
Beware of "script async defer" blocking HTML "load" event

Beware of <script async defer> blocking HTML "load" event

2015.10.07 t

On the importance of simulated latency testing, and bulletproofing your page from the third-party JS load failures

TL;DR

@zabirauf
zabirauf / expng.ex
Created July 23, 2015 08:32
PNG format Parser in Elixir
defmodule Expng do
defstruct [:width, :height, :bit_depth, :color_type, :compression, :filter, :interlace, :chunks]
def png_parse(<<
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A,
_length :: size(32),
"IHDR",
width :: size(32),
height :: size(32),
@jhenly
jhenly / hosts
Last active January 29, 2016 14:24
/etc/hosts - An ongoing list of ad/stupid sites to block traffic from.
# /etc/hosts
127.0.0.1 localhost
# Block traffic from these ad sites:
#+ doubleclick domains
0.0.0.0 doubleclick.net
0.0.0.0 www.doubleclick.net
0.0.0.0 cm.g.doubleclick.net
0.0.0.0 www.cm.g.doubleclick.net
<br /><br />
# React Native: Animated
ReactEurope 2015, Paris - Spencer Ahrens - Facebook
<br /><br />
## Fluid Interactions
- People expect smooth, delightful experiences
@sahrens
sahrens / React Native: Animated - Code
Last active July 4, 2020 00:07
Example code from ReactEurope 2015 talk - React Native: Animated
/**
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
@ohanhi
ohanhi / frp.md
Last active May 7, 2026 01:30
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@egri-nagy
egri-nagy / merge-sort-single-fn.clj
Created May 10, 2015 23:57
Merge sort in Clojure in a single function
(defn merge-sort
"sorting the given collection with merge-sort"
[coll]
(if (or (empty? coll) (= 1 (count coll)))
coll
(let [[l1 l2] (split-at (/ (count coll) 2) coll)]
;recursive call
(loop [r [] l1 (merge-sort l1) l2 (merge-sort l2)]
;merging
(cond (empty? l1) (into r l2) ;when l1 is exhausted
@kevgathuku
kevgathuku / docker-cleanup.sh
Created February 17, 2015 22:16
Remove docker temporary built images
#!/bin/bash
# Source: http://blog.stefanxo.com/2014/02/clean-up-after-docker/
docker images -f dangling=true -q | xargs -r docker rmi -f #Adding -f forces removal
@P7h
P7h / tmux__CentOS__build_from_source.sh
Last active October 11, 2025 01:02
tmux 2.0 and tmux 2.3 installation steps for Ubuntu. Or build from tmux source v2.5 for Ubuntu and CentOS.
# Steps to build and install tmux from source.
# Takes < 25 seconds on EC2 env [even on a low-end config instance].
VERSION=2.7
sudo yum -y remove tmux
sudo yum -y install wget tar libevent-devel ncurses-devel
wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz
tar xzf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}