This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as storage from 'redux-storage' | |
import filter from 'redux-storage-decorator-filter'; | |
import { createStore, applyMiddleware } from 'redux'; | |
// For this example I'm using a simple in-memory engine. Thus should obiously | |
// be repalced with something real :-) | |
function createEngine(name, value) { | |
return { | |
load() { | |
return Promise.resolve(value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var socket = require('socket.io-client')('http://127.0.0.1:3000'); | |
socket.on('connect', function(io){ | |
console.log('[CLIENT] connected'); | |
var data = { name: 'hans' }; | |
console.log('[CLIENT] sending json:', '(' + typeof data + ')', data); | |
socket.emit('json', data); | |
var data = 'hello world'; | |
console.log('[CLIENT] sending string:', '(' + typeof data + ')', data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# setup: pip install requests beautifulsoup4 | |
from decimal import Decimal | |
import requests | |
from bs4 import BeautifulSoup | |
import sys | |
import getpass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
maven { | |
url('http://repository.openbakery.org/') | |
} | |
mavenCentral() | |
} | |
dependencies { | |
classpath "org.openbakery:xcode-plugin:0.11.+" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var React = require('react/addons'); | |
var PureRenderMixin = React.addons.PureRenderMixin; | |
var MAX_LOADING_TASKS = 3; | |
var loadingQueue = []; | |
var loadingQueueDirty = false; | |
var loadingTasks = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fmt; | |
use std::num; | |
struct Point3 { | |
x: f64, | |
y: f64, | |
z: f64, | |
} | |
impl Point3 { | |
fn new(x: f64, y: f64, z: f64) -> Point3 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class A | |
{ | |
public function __construct() | |
{ | |
$this->lambda = function() { | |
echo "Hello World!"; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
url_svn() { | |
local svn_branch_url=$(git svn info | grep URL: | cut -d' ' -f2) | |
local svn_branch_url=${svn_branch_url/\/trunk/\/branches} | |
local svn_branch_url=${svn_branch_url/\/trunk\//\/branches} | |
local svn_branch_url=${svn_branch_url/\/branches\/*/\/branches} | |
echo $svn_branch_url | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
sed -i '' -e 's/^antigen bundle/#antigen bundle/' ~/.zshrc | |
tests=$(grep "#antigen bundle" ~/.zshrc | wc -l) | |
last_sum=0 | |
for it in $(seq 1 $tests); do | |
sum=0 | |
name=$(grep '#antigen bundle' ~/.zshrc | head -n 1 | cut -d' ' -f3) | |
sed -i '' -e '1,/#antigen bundle/s/#//' ~/.zshrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from redis import from_url as redis_from_url | |
def create_api(app): | |
access_key_id = app.config["AMAZON_ACCESS_KEY"] | |
secret_access_key = app.config["AMAZON_SECRET_KEY"] | |
associate_tag = app.config["AMAZON_ASSOCIATE_TAG"] | |
locale = app.config["AMAZON_LOCALE"] | |
redis = redis_from_url(app.config["AMAZON_REDIS_URL"]) |
NewerOlder