Skip to content

Instantly share code, notes, and snippets.

View jhsu's full-sized avatar
💀
compliant with future standards

Joe Hsu jhsu

💀
compliant with future standards
  • MineHub
  • New York, NY
  • X @jhsu
View GitHub Profile
import { createStore, applyMiddleware } from 'redux';
import thunkMiddleware from 'redux-thunk';
import apiMiddleware from '../middleware/api';
import loggerMiddleware from 'redux-logger';
import rootReducer from '../reducers';
const createStoreWithMiddleware = applyMiddleware(
thunkMiddleware,
apiMiddleware,
loggerMiddleware
{
"retainLines": true,
"compact": true,
"comments": false,
"whitelist": [
"es6.arrowFunctions",
"es6.blockScoping",
"es6.classes",
"es6.constants",
"es6.destructuring",
@jhsu
jhsu / dlet.clj
Created June 17, 2015 16:35
print out values of a let statement. taken from: http://blog.gaz-jones.com/2012/02/04/debug_let.html
(defmacro dlet [bindings & body]
`(let [~@(mapcat (fn [[n v]]
(if (or (vector? n) (map? n))
[n v]
[n v '_ `(println (name '~n) ":" ~v)]))
(partition 2 bindings))]
~@body))
<?xml version="1.0" encoding="UTF-8" ?>
<GraphicsConfig>
<MinimumAspectRatio>1.0</MinimumAspectRatio>
<HDRNode>
<KeyValue>0.500000</KeyValue>
<WhiteLevel>0.000000</WhiteLevel>
<DisplayLumScale>164.000000</DisplayLumScale>
<HistogramSampleWidth>60.500000</HistogramSampleWidth>
<ExposureThreshold>1.000000</ExposureThreshold>
<Percentiles>0.010000,0.540000,0.999000</Percentiles>
var Rx = require('rx');
// Create draggable element, nothing fancy going on here
var box = document.createElement('div');
box.style.width = box.style.height = '100px';
box.style.backgroundColor = 'grey';
box.style.position = 'absolute';
box.innerText = 'Drag me';
document.body.appendChild(box);
@jhsu
jhsu / index.js
Created December 8, 2014 22:55
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'ul',
classNames: ['pagination-navigation'],
hasNext: function() {
return this.get('page') < this.get('pages');
}.property('page', 'pages'),
hasPrevious: function() {
return this.get('page') > 1;
<a ui-sref="dashboard.child">show the child view</a>
<div ui-view></div>