Skip to content

Instantly share code, notes, and snippets.

@acousineau
acousineau / ReduxSelectorPattern.js
Last active September 27, 2017 13:47
Redux Selector Pattern Primer and Flow
// MyComponent.js
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { fetchTheThings } from 'actions';
import { selectAsyncProp } from 'index-reducer';
class MyComponent extends Component {
componentDidMount() {
this.props.fetchTheThings();
@Slater-Victoroff
Slater-Victoroff / gist:6681032
Last active December 23, 2015 19:09
Simple Flask Server for parsing LabView XML and doing some scant logic.
import flask
import sys
from flask import Flask, request
import random
from lxml import etree
import xmltodict
import numpy as np
import operator
@Slater-Victoroff
Slater-Victoroff / PyMarkov
Last active March 28, 2022 13:55
Arbitrary ply markov constructor in python
from collections import Counter
import cPickle as pickle
import random
import itertools
import string
def words(entry):
return [word.lower().decode('ascii', 'ignore') for word in entry.split()]
def letters(entry):
@aisipos
aisipos / jsonp-in-flask.py
Created July 20, 2011 01:20 — forked from farazdagi/jsonp-in-flask.py
JSONP in Flask
import json
from functools import wraps
from flask import redirect, request, current_app
def support_jsonp(f):
"""Wraps JSONified output for JSONP"""
@wraps(f)
def decorated_function(*args, **kwargs):
callback = request.args.get('callback', False)
if callback:
@vangberg
vangberg / DWM-ON-OS-X.md
Created February 22, 2010 19:24
dwm on os x [work in progress!]

Installing and configuring dwm on OS X

  1. Install XQuartz (http://xquartz.macosforge.org) which is the development version of the X11.app that ships with OS X, which means it is way more up to date. I have had some weird issues with X11.app v. 2.3-something. XQuartz 2.5.0 fixed that.

  2. Install dwm from Homebrew, brew install dwm. This makes a bunch of necessary tweaks to the DWM configuration.

  3. Add the following script to $PATH, name it dwm-launch and chmod 755:

    cd ~
    

while true