Skip to content

Instantly share code, notes, and snippets.

View insin's full-sized avatar
⚠️
Cannot read property 'status' of undefined

Jonny Buchanan insin

⚠️
Cannot read property 'status' of undefined
View GitHub Profile
@insin
insin / extendSrsly.js
Last active August 29, 2015 14:08
extend() which protects against new not being used in the default constructor it generates http://bl.ocks.org/insin/raw/db5f79d7d97ee6200245/
// Modification of extend from Backbone.js 1.1.2
// Helper function to correctly set up the prototype chain, for subclasses.
// Similar to `goog.inherits`, but uses a hash of prototype properties and
// class properties to be extended.
var extendSrsly = function() {
var hasOwn = Object.prototype.hasOwnProperty;
function extend(dest, src1, src2) {
for (var prop in src1) {
/**
* Adapted from https://github.com/Khan/react-components/blob/master/js/timeout-transition-group.jsx
*/
var React = require('react/addons');
var ReactTransitionGroup = React.addons.TransitionGroup;
var Velocity = require('velocity-animate');
var transitions = {
// Forcefeeding: property order = [after, before]
@insin
insin / .jshintrc
Last active August 24, 2025 21:25
Template for HTA / browser React apps
{
"browser": true,
"node": true,
"curly": true,
"devel": true,
"globals": {
"ActiveXObject": true,
"async": true,
"moment": true,
fieldName: String
errorCode: String
Form {
data: fieldName -> Any
initial: fieldName -> Any
fields: fieldName -> Field
_errors: ErrorObject
}
@insin
insin / newforms.md
Last active August 29, 2015 14:08
newforms object hierarchy
@insin
insin / index.html
Created October 18, 2014 09:30
My 7 year-old's new favourite webpage
<!DOCTYPE html>
<script>
function sayIt() {
speechSynthesis.speak(
new SpeechSynthesisUtterance(document.querySelector('textarea').value)
)
}
</script>
<textarea></textarea><br>
<input type="button" value="Say It!" onclick="sayIt()">
@insin
insin / app.jsx
Last active August 29, 2015 14:07
A failed attempt to implement block inheritance using React contexts (Live version with console logs: http://bl.ocks.org/insin/raw/bcca5b64c6bcf95ad535/)
'use strict';
var BlocksMixin = {
contextTypes: {
blocks: React.PropTypes.object
},
childContextTypes: {
blocks: React.PropTypes.object.isRequired
},
@insin
insin / app.jsx
Last active August 29, 2015 14:06
R E A C T O M E T E R (Live version: :http://bl.ocks.org/insin/raw/efb444d8e0390da2c7ec/)
/** @jsx React.DOM */
'use strict';
var Ometer = React.createClass({
propTypes: {
leading: React.PropTypes.string
, highlight: React.PropTypes.func
, spacing: React.PropTypes.bool
, suffix: React.PropTypes.string
@insin
insin / gist:dfe7cea8a6ac7691127e
Created August 20, 2014 11:09
hoodie new cantdo
C:\code\javascript>hoodie new cando
.d$b. .d$b. .d$$$$$$b. .d$$$$$$b. .d$$$$$$b. .d$b..d$$$$$$$$b.
$$$$$..$$$$$.$$$$$$$$$$$b .$$$$$$$$$$$b $$$$$$$$$$b $$$$$$$$$$$$$$$P'
$$$$$$$$$$$$d$$$$$$$$$$$$bd$$$$$$$$$$$$b$$$$$$$$$$$b$$$$$$$$$$$$$$$b.
$$$$$$$$$$$$Q$$$$$$$$$$$$PQ$$$$$$$$$$$$P$$$$$$$$$$$P$$$$$$$$$$$$$$$P'
$$$$$´`$$$$$'$$$$$$$$$$$$''$$$$$$$$$$$$'$$$$$$$$$$P $$$$$$$$$$$$$$$b.
'Q$P' 'Q$P' 'Q$$$$$$P' 'Q$$$$$$P' 'Q$$$$$$$P 'Q$P''Q$$$$$$$$P'
Version: 0.6.0 (node v0.10.29, npm 1.5.0-alpha-4, platform: win32)
@insin
insin / index.html
Last active August 29, 2015 14:04
Just waiting for inspiration to strike...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>???</title>
<script src="localforage-0.9.2.js"></script>
<script src="react-with-addons-0.11.1.js"></script>
<script src="react-router-0.5.0.js"></script>
<script src="JSXTransformer-0.11.1.js"></script>
<style>