Skip to content

Instantly share code, notes, and snippets.

@crankyadmin
crankyadmin / example.cljs
Created October 28, 2016 09:29 — forked from olivergeorge/example.cljs
reframe-vs-react-virtualized
(ns example.virtualized
(:require cljsjs.react-virtualized
cljsjs.react
[cljs.spec :as s]
[re-frame.core :as re-frame]))
(def ArrowKeyStepper* (js/React.createFactory js/ReactVirtualized.ArrowKeyStepper))
(def AutoSizer* (js/React.createFactory js/ReactVirtualized.AutoSizer))
(def Collection* (js/React.createFactory js/ReactVirtualized.Collection))
@crankyadmin
crankyadmin / core.cljs
Created August 16, 2016 12:04 — forked from ducky427/core.cljs
Facebook's fixed data for reagent. Adapted from https://github.com/ul/fixed-data-table-demo
(ns datatable.core
(:require [reagent.core :as reagent]
[cljsjs.fixed-data-table]))
(def Table (reagent/adapt-react-class js/FixedDataTable.Table))
(def Column (reagent/adapt-react-class js/FixedDataTable.Column))
(defn gen-table
"Generate `size` rows vector of 4 columns vectors to mock up the table."
[size]
@crankyadmin
crankyadmin / actions.cljs
Created August 16, 2016 07:54 — forked from stephendeyoung/actions.cljs
ClojureScript function to show a Bootstrap dropdown.
(defn actions [array-of-funcs]
(doseq [func array-of-funcs] (func)))
#!/usr/bin/env sh
# Stored at: https://gist.github.com/4452136
# Assumes the given path points to a FLV file with MP4 video.
# Use ffmpeg to repackage the file.
ffmpeg -i "$1" -acodec copy -vcodec copy "$1".mp4
# old version:
# Not used anymore as VLC seems to have a bug that creates broken

Flask + uWSGI + nginx Primer

I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.

How this shit works

  • Flask is managed by uWSGI.
  • uWSGI talks to nginx.
def my_func():
return "embedding?"
# ~/.gitconfig from @boblet
# initially based on http://rails.wincent.com/wiki/Git_quickstart
[core]
excludesfile = /Users/oli/.gitignore
legacyheaders = false # >git 1.5
quotepath = false
# http://stackoverflow.com/questions/136178/git-diff-handling-long-lines
pager = less -r
# if ↑ doesn’t work, try: pager = less -+$LESS -FRX