Skip to content

Instantly share code, notes, and snippets.

View OscarGodson's full-sized avatar
:shipit:
Workin'

Oscar Godson OscarGodson

:shipit:
Workin'
  • CTO
  • Portland, OR
  • 18:47 (UTC -07:00)
View GitHub Profile
/** @jsx React.DOM */
function makeStubbedDescriptor(component, props, contextStubs) {
var TestWrapper = React.createClass({
childContextTypes: {
currentPath: React.PropTypes.string,
makePath: React.PropTypes.func.isRequired,
makeHref: React.PropTypes.func.isRequired,
transitionTo: React.PropTypes.func.isRequired,
replaceWith: React.PropTypes.func.isRequired,
goBack: React.PropTypes.func.isRequired,
@larzconwell
larzconwell / gist:6076307
Last active December 20, 2015 05:09
A new shell language reference/specification

Hive

Comments

# Single-line comments

##
  Multi-line comments
##
function clone(object) {
var cloned = Object.create(object.prototype || null);
Object.keys(object).map(function (i) {
cloned[i] = object[i];
});
return cloned;
}
@OscarGodson
OscarGodson / demo.html
Created February 25, 2012 02:03
Send mail via JS and JSONP with some shitty PHP code
<!DOCTYPE html>
<html>
<head>
<title>JS Bin</title>
<style>
</style>
</head>
<body>
<p id="sending">Sending mail...</p>
<script class="jsbin" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>

#Why I Don't Use CoffeeScript

CoffeeScript in of itself, and not as a transpiled language, is slick. The problem for me is what it's supposedly "fixing".

##Syntax Sugar

For a Rails and Python developer JS is ugly (as I hear). You have... dun dun dun, curly brackets and white space doesn't mean anything (oh the humanity!). But, I like my whitespace. I like not being restricted on how I write my code aesthetically. Not to mention CoffeeScript is by far less human readable than JavaScript. Programming languages, IMO, need to be a good balance of both human and machine readable. Simple example:

cube = (x) -&gt; square(x) * x