#render me?
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 { handleActions } from 'redux-actions' | |
import { INVOICE } from '../constants' | |
import { INVOICE_JSON } from '../data' | |
import { array, target, update } from 'redux-modifiers' | |
let obj = {}; | |
let { ADD, UPDATE, REMOVE, RECIPIENT_ADD, ITEM_REMOVE, ITEM_ADD } = INVOICE; | |
let pl = (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
import { connect } from 'react-redux' | |
const stateConnector = function(){ | |
let stateKeys = Array.from(arguments); | |
let obj={}; | |
return connect((state)=>{ | |
stateKeys.forEach((key)=>{ | |
obj[key] = state[key]; | |
}); |
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 node | |
var sync = require('child_process').spawnSync; | |
var fs = require('fs'); | |
var START = '<!--(auto-->'; | |
var END = '<!--/auto)-->'; | |
function makeSection(file, title){ | |
var json = JSON.parse(sync('./node_modules/react-docgen/bin/react-docgen.js', ['--pretty', './'+file]).output[1].toString()); | |
var str = "## "+title+"\n\n"; |
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
''' | |
Pros: | |
- Get the spawned thread (use thread.join() to wait on it, for example) | |
- Get the future | |
- Calling worker.future.result() will automatically raise an exception in the main thread | |
''' | |
from concurrent.futures import Future | |
import threading | |
import time |
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
<!--<img class="svg-clipped" src="http://sarasoueidan.com/demos/css-svg-clipping/html-img-clipped-with-css-svg-clippath/flowers.jpg" style=""/>--> | |
<svg height="100" width="100"> | |
<defs> | |
<pattern id="img1" patternUnits="userSpaceOnUse" width="100" height="100"> | |
<image xlink:href="http://sarasoueidan.com/demos/css-svg-clipping/html-img-clipped-with-css-svg-clippath/flowers.jpg" x="0" y="0" width="100" height="100" /> | |
</pattern> | |
</defs> | |
<path fill="url(#img1)" stroke="#000000" stroke-width="0" stroke-miterlimit="" d="M 74.3243675,137.7170575 C 70.8806075,133.8579775 62.2817,126.3346375 55.2156925,120.99853 C 34.2796675,105.18807 31.43027,102.899975 22.9298095,95.07272 C 7.2586775,80.6426775 0.6034055,66.145215 0.62621195,46.48781 C 0.63733985,36.8918475 1.2914038,33.1948225 3.9786835,27.538495 C 8.53785825,17.94206675 15.253749,10.81116675 23.840013,6.44986425 C 29.9213625,3.36091875 32.920675,1.98855115 43.07612,1.9324059 C 53.6994425,1.8736974 55.9357775,3.11233675 62.1847975,6.54536475 C 6 |
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 listchooser = function(choices, opts){ | |
var opts = opts || {}; | |
opts.transforms = opts.transforms || {}; | |
opts.events = opts.events || {}; | |
var container = $('<div></div>'); | |
if(opts.transforms.container){ | |
opts.transforms.container(container); | |
} |
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
''' | |
"operator":[precedence, associativity] | |
''' | |
operators = { | |
"#":[5, "r", lambda x:x*-1], #unary minux | |
"^":[4, "r", lambda x,y: pow(x, y)], | |
"*":[3, "l", lambda x,y: x*y], | |
"/":[3, "l", lambda x,y: x/y], | |
"+":[2, "l", lambda x,y: x+y], | |
"-":[2, "l", lambda x,y: x-y] |
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 quizStore = require('../dist/quiz').quizStore; | |
var quizInstance = require('../dist/quiz').quizInstance; | |
var md5 = require('md5'); | |
var sampleQuiz = function(){ | |
return { | |
name: 'test', | |
questions: [ | |
[ | |
'the question', |
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' | |
#deps | |
redis = require('redis') | |
cryptoService = require('../lib/crypto') | |
module.change_code = 1 | |
''' | |
Possible options: | |
expiry: number of seconds till key is deleted from cache |