Skip to content

Instantly share code, notes, and snippets.

View kaw2k's full-sized avatar

Rasa Welcher kaw2k

View GitHub Profile
/// <reference types="react" />
declare namespace MaterialUI {
type ReactEl = React.ReactChild | null | boolean
export interface MuiTheme {
palette: {
primary?: string,
accent?: string,
@kaw2k
kaw2k / functors.md
Last active January 23, 2016 01:36

A Map to Success: Functors in Javascript

I wanted to take some time to talk about the humble map function. If you have ever used libraries like underscore, lodash, or ramda, you are sure to encounter more than a few curious functions. The unassuming map function is a good starting point on our journey to functional nirvana.

Making a map

Taking a step back, what is map? Just like normal maps (the paper kind!), map is a guide to get from one place to another.

For example, in your notebook you have a list of numbers: 1 2 3. Next to that list you write 2 3 4. How did this happen? Simply enough, we went over each number in the list and added one to it. In other words, we mapped over the list of numbers and added one to them.

@mattd
mattd / proxy.js
Last active December 19, 2015 16:48
Stupid simple proxy from your dev environment to any arbitrary remove server.
// Usage from some other file:
//
// var app = require('./proxy')({proxyUrl: '//your-remote.com', proxyBase: '/api'})
var path = require('path'),
request = require('request'),
express = require('express'),
app = express();
app.use(express.logger('dev'));
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname