Skip to content

Instantly share code, notes, and snippets.

@zpao
zpao / quake.js
Created May 27, 2012 01:07
quick little node script to show growl alerts when the ground shakes
var request = require("request");
var csv = require("csv");
var growl = require("growl");
const URL = "http://earthquake.usgs.gov/earthquakes/catalogs/eqs1hour-M0.txt";
const INTERVAL = 20000;
// this is what the keys map to
var keys = ['Src', 'Eqid', 'Version', 'Datetime', 'Lat', 'Lon', 'Magnitude', 'Depth', 'NST', 'Region'];
var quakes = {};
@zpao
zpao / requests.js
Created May 27, 2012 01:24
simple node script to check on your review queue
require("request");
var bz = require("bz");
var bugzilla = bz.createClient();
function getRequests(email) {
bugzilla.searchBugs({"flag.requestee": email}, function(err, bugs) {
bugs.forEach(function(bug) {
console.log(formatBugOutput(bug));
})
# HG changeset patch
# Parent 18542ed8614b337f29235d846133d15be1f6f065
# User Paul O’Shannessy <paul@oshannessy.com>
diff --git a/browser/base/content/browser-sets.inc b/browser/base/content/browser-sets.inc
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -68,16 +68,17 @@
<command id="cmd_pageSetup" oncommand="PrintUtils.showPageSetup();"/>
<command id="cmd_print" oncommand="PrintUtils.print();"/>
@zpao
zpao / code_highlight_lines.rb
Created May 10, 2013 20:19
Highlight specific lines of code with Markdown + Jekyll + Redcarpet
# Replace Jekyll's handling of the Redcarpet code_block (which already adds
# support for highlighting, but needs support for the very non-standard
# "code fences with line highlights" extension).
# Since this is currently depending on Redcarpet to cooperate, we are going to
# be naive, and only allow line highlighting when a language is specified. If
# you don't want any syntax highlighting but want to highlight lines, then you
# need to specify text as your language (or it will break), like:
# ```text{4}
module Jekyll
/** @jsx React.DOM */
var MyComponent = React.createClass({
render: function() {
// Defaults in case the props are undefined. We'll have a solution for this
// soon that is less awkward.
var perMinute = this.props.perMinute || '-';
var perDay = this.props.perDay || '-';
return (
<div>
<h3>Clickouts</h3>
@zpao
zpao / gist:5818982
Last active December 18, 2015 17:29
React 0.3.3 Plans
@zpao
zpao / proposal.md
Last active December 21, 2015 14:48
JSX DOM Conventions proposals

Conventions for React DOM & JSX

There's been a lot of discussion lately around how React should use JSX to describe DOM nodes. Thanks to @piranha for sparking this discussion in facebook/react#269

To summarize the current convention of React DOM nodes such as <div /> and <span />.

  • All React DOM elements expect camelCased versions of attributes.
  • camelCasing is natural in a JavaScript-centric programming paradigm (like React).
  • the camelCasing of DOM matches what you would write for custom components:
  • and
commit 9e2d6e904015bb1c31af23190ebc05a41cbe21c6
Author: Paul O’Shannessy <paul@oshannessy.com>
Date: Thu Oct 3 11:05:42 2013 -0700
yup
diff --git a/src/dom/components/ReactDOMInput.js b/src/dom/components/ReactDOMInput.js
index a569a5e..cfd4982 100644
--- a/src/dom/components/ReactDOMInput.js
+++ b/src/dom/components/ReactDOMInput.js
diff --git a/src/dom/components/ReactDOMInput.js b/src/dom/components/ReactDOMInput.js
index a569a5e..698fc59 100644
--- a/src/dom/components/ReactDOMInput.js
+++ b/src/dom/components/ReactDOMInput.js
@@ -55,7 +55,7 @@ var ReactDOMInput = ReactCompositeComponent.createClass({
var defaultValue = this.props.defaultValue;
return {
checked: this.props.defaultChecked || false,
- value: defaultValue != null && defaultValue !== false ? defaultValue : ''
+ value: defaultValue != null ? defaultValue : ''
@zpao
zpao / all (abc)
Last active December 31, 2015 04:19
5 Alexander Solovyov <alexander@solovyov.net>
6 Andreas Svensson <andreas@syranide.com>
2 Andrew Zich <azich@fb.com>
4 Andrey Popp <8mayday@gmail.com>
90 Ben Alpert <spicyjalapeno@gmail.com>
96 Ben Newman <bn@cs.stanford.edu>
1 Brian Cooke <bri@bricooke.com>
1 Brian Kim <briankimpossible@gmail.com>
2 Brian Rue <brian@rollbar.com>
1 Cam Spiers <camspiers@gmail.com>