Skip to content

Instantly share code, notes, and snippets.

View zzgvh's full-sized avatar

Gabriel von Heijne zzgvh

  • Concinnity AB
  • Stockholm
View GitHub Profile
@senko
senko / maybe.py
Last active May 2, 2024 18:35
A Pythonic implementation of the Maybe monad
# maybe.py - a Pythonic implementation of the Maybe monad
# Copyright (C) 2014. Senko Rasic <senko.rasic@goodcode.io>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@couchand
couchand / react-d3.js
Created March 5, 2014 16:02
Integrating D3 charts into React.js applications
/** @jsx React.DOM */
// d3 chart function
// note that this is a higher-order function to
// allowing passing in the component properties/state
update = function(props) {
updateCircle = function(me) {
me
.attr("r", function(d) { return d.r; })
.attr("cx", function(d) { return 3 + d.r; })
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 4, 2024 21:33
A badass list of frontend development resources I collected over time.
@selenamarie
selenamarie / liberate.sql
Last active December 17, 2015 17:29
I wrote this as prep for a talk about JSON datatype and PLV8: https://speakerdeck.com/selenamarie/schema-liberation-with-json-and-plv8-and-postgres
CREATE SCHEMA liberated;
CREATE OR REPLACE FUNCTION public.liberate()
RETURNS boolean
LANGUAGE plv8
AS $function$
var tables = plv8.execute(
"select relname FROM pg_catalog.pg_class"
+ " c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace"
@jessykate
jessykate / django-crossdomainxhr-middleware.py
Created June 16, 2012 12:44 — forked from vicalejuri/django-crossdomainxhr-middleware.py
Middlware to allow's your django server to respond appropriately to cross domain XHR (postMessage html5 API).
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
'''
EXAMPLE USAGE:
Put this file in a directory called, eg, 'middleware,' inside your django
@epicserve
epicserve / Django Enviroment Setup on Mac OSX 10.6.2 (Snow Leopard).markdown
Created February 22, 2010 15:29
Django Enviroment Setup on Mac OSX 10.6.2 (Snow Leopard)

Django Enviroment Setup on Mac OSX 10.6.2 (Snow Leopard)

Install Homebrew

sudo mkdir /usr/local
sudo chown -R `whoami` /usr/local
curl -L http://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C /usr/local
brew install git
cd /usr/local
git init