Skip to content

Instantly share code, notes, and snippets.

@HelveticaScenario
HelveticaScenario / liveFyre.html
Last active August 29, 2015 13:59
technical assessment for liveFyre
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<meta charset=utf-8 />
<title>liveFyre assessment</title>
</head>
<body>
<canvas id="myChart" width="1200" height="400"></canvas>
@HelveticaScenario
HelveticaScenario / ReactSurface.js
Last active August 29, 2015 14:00
React.js as a famo.us surface
/*
This is an extension of the famo.us Surface type. It behaves the exact same except that the content
property holds a ProxyConstructor object (the type that gets returned by any of the React component
functions such as those in React.DOM or created by React.createClass) instead of a string or Node.
One thing to note is that the component fed in to content will get an extra prop, _surface, which
is the surface object that holds it
example usage
var TestComponent = React.createClass({
@HelveticaScenario
HelveticaScenario / listenAndNotify.js
Created August 25, 2015 08:07
a script that does speech recognition and creates notifications of the transcripts.
function createListener() {
console.log('creating new listener');
var recognition = new webkitSpeechRecognition();
recognition.continuous = true;
recognition.interimResults = true;
var res = [];
recognition.onresult = function(event) {
for (var i=0; i < event.results.length; i++) {
var resultList = event.results[i];
if (!resultList.isFinal) {
@HelveticaScenario
HelveticaScenario / gist:7793092
Last active December 30, 2015 06:59
Humble Bundle purchased game counter
/*
Description: JS snippet to determine how many games you have in your humble bundle library
for a given platform. it won't filter duplicates (it does happen, but its rare) and it
will only count the ones in the main list(s), which appear to only be the drm free ones,
so those purchased via bundles that only give you steam keys, such as the humble THQ
bundle or the humble jumbo bundle, wont be included in the count.
Instructions: navigate to your main humble bundle library, select one of the platform
filters (eg. Windows, Mac OS X), open the browser console (in Chrome on mac the
shortcut is cmd-alt-j), and copy this snippit into the prompt and press
@HelveticaScenario
HelveticaScenario / 0_reuse_code.js
Created January 23, 2014 19:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@HelveticaScenario
HelveticaScenario / html_character_encode_map.clj
Created January 23, 2014 19:51
the cmap to be used with the clojure escape function to encode text for use in html
{\& "&amp", \< "&lt", \> "&gt", \" "&quot", \' "&apos"}
@HelveticaScenario
HelveticaScenario / customResize.tsx
Last active June 15, 2017 01:33
two implementations of a react component for resizing rendering text line by line to fit a container
import * as React from 'react'
import testContent from './content'
import { make2dContext, throttle } from './utils'
interface EditorState {
readonly font: string
readonly str: string
readonly words: ReadonlyArray<string>
readonly lines: ReadonlyArray<string>
@HelveticaScenario
HelveticaScenario / handleChangeCurried.ts
Last active June 17, 2017 01:10
a typesafe curried react input handler using ramda
import * as R from 'ramda'
const _handleChangeCurried = function<S, P>() {
return <K extends keyof S>() => {
return R.curry<
React.Component<any, S>,
K,
React.FormEvent<HTMLInputElement>,
void
>((self, key, e) =>

Keybase proof

I hereby claim:

  • I am helveticascenario on github.
  • I am hscenario (https://keybase.io/hscenario) on keybase.
  • I have a public key ASDg1rzH-1Ivxrp6KjnBG2XbbTx9a8AvSbzoqwfyYYWmLQo

To claim this, I am signing this object:

function _draw() {
rect(20,50,70,90)
}