Skip to content

Instantly share code, notes, and snippets.

View kevgathuku's full-sized avatar

Kevin Gathuku kevgathuku

View GitHub Profile
@yang-wei
yang-wei / destructuring.md
Last active February 20, 2024 04:40
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
@janoliver
janoliver / tutorial.md
Last active May 5, 2024 13:00
Arch Linux as a Web Server

In this tutorial, I briefly explain how to set up a webserver using nginx, openssl and uwsgi on Arch Linux. The tutorial is applicable to other Linux distributions and goes through the required configuration step by step. It is, I believe, beginner friendly.

0. Version

I updated, changed and tested the tutorial on Dec. 8th, 2013. All commands and configuration files relate to the software versions that are currently available in the Arch package repositories. Especially nginx and uwsgi change often and

@mikermcneil
mikermcneil / sails.sockets.broadcast() examples.md
Last active October 5, 2019 05:23
Examples of broadcasting to a room or emitting to a single socket in your Sails app using sails.sockets.broadcast().
@manuelbieh
manuelbieh / sequelize-schema-file-generator.js
Last active January 16, 2024 19:25
Automatically generates migration files from your sequelize models
import * as models from "models";
import Sequelize from "sequelize";
import fs from "fs";
delete models.default;
const sequelize = new Sequelize(
'',
'',
'', {
@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