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
<a ui-sref="dashboard.child">show the child view</a>
<div ui-view></div>
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;
@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")
<?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>
@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))
{
"retainLines": true,
"compact": true,
"comments": false,
"whitelist": [
"es6.arrowFunctions",
"es6.blockScoping",
"es6.classes",
"es6.constants",
"es6.destructuring",
@jhsu
jhsu / Heartpts
Created August 18, 2008 03:49
Heartpts description for fbFund
purpose
=======
Heartpts is the point system of love. It provides a fun way for a couple to keep the score and provide a channel for better communication.
application information
=======================
Heartpts allows someone in a relationship to give or subtract points from his/her partner and provide a reason. The visible number of points adds a fun competitive element to communication in a relationship.
In the future, I see Heartpts providing goals that couples can set up and try to obtain by trying to improve their relationship. These goals may be coupled with things such as a movie date or dinner with which I would want to provide some sort of discount for users.
# download and git methods swiped from http://github.com/Sutto/rails-template/blob/07b044072f3fb0b40aea27b713ca61515250f5ec/rails_template.rb
require 'open-uri'
def download(from, to = from.split("/").last)
#run "curl -s -L #{from} > #{to}"
file to, open(from).read
rescue
puts "Can't get #{from} - Internet down?"
exit!
// ==UserScript==
// @name Lighthouse theme for Trac
// @namespace http://philwilson.org
// @description Lighthouse theme for Trac
// @include http://www.viralogy.com:8000/*