Instantly share code, notes, and snippets.

View RN_NavigationExperimental_CardStack_example.js
// NavigationExperimental CardStack example
// Usage: this.props.dispatch(pushRoute({ key: 'registration' }))
/* ****** */
/* App.js */
/* ****** */
import React, { Component, View } from 'react';
import {
NavigationExperimental,
View marker clustering
componentWillReceiveProps(nextProps) {
if (nextProps.lastRequestedUserLocationAt > this.props.lastRequestedUserLocationAt) {
this.centerMapToUser(nextProps.currentLocation);
}
if (nextProps.lastUpdated > this.props.lastUpdated) {
const markers = this.createMarkersForLocations(nextProps);
if (markers && Object.keys(markers)) {
const clusters = {};
View ynanb
# ynanb (You need a Nordea Budget) by Ian Tuomi (iant@iki.fi), MIT Licence
import csv
import datetime
import itertools
def convertDate(nordea_date):
nordea_format = '%d.%m.%Y'
ynab_format = '%m/%d/%Y'
ynab_date = datetime.datetime.strptime(nordea_date, nordea_format).strftime(ynab_format)
View app.js
lineChart("ranking.csv"
, ["#0072C5", "#FFA824", '#E21831', '#3E0605']
, "#example");
function lineChart(filePath, colors, selector) {
var x_column = "Year";
var constructedData;
d3.dsv(";", "text/plain")(filePath, function(error, data) {
data.map(function(d){
View app.js
var shortData = [{
'Title': 'Kandidaatiksi',
'Value': 18691
}, {
'Title': 'Maisteriksi',
'Value': 9494
}, {
'Title': 'Lisensiaatiksi',
'Value': 235
}, {
View gist:3e835955d0db554d76b7
;;; haskell-font-lock.el --- Font locking module for Haskell Mode
;; Copyright 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Copyright 1997-1998 Graeme E Moss, and Tommy Thorn
;; Author: 1997-1998 Graeme E Moss <gem@cs.york.ac.uk>
;; 1997-1998 Tommy Thorn <thorn@irisa.fr>
;; 2003 Dave Love <fx@gnu.org>
;; Keywords: faces files Haskell
View Edit Distance
public class EditDist {
public enum METHOD {
KEEP, CHANGE, INSERT, DELETE;
}
private static class Solution {
public int price;
public METHOD method;
public Solution() {}
View gist:9248658
from instagram import client, subscriptions
import urllib2
import sys
CONFIG = {
'client_id': '5b8ae8f010d64112a48f969b6af736d5',
'client_secret': '6cdf09f8c92644f68d6846000880752e',
'redirect_uri': 'http://localhost:8515/oauth_callback'
}
View Ruby Notepad Bookmarklet
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>