Skip to content

Instantly share code, notes, and snippets.

@chantastic
chantastic / on-jsx.markdown
Last active November 10, 2024 13:39
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@searls
searls / notes.md
Created February 18, 2012 18:18
Stack traces I get when I attempt to install native Ruby extensions on OS X 10.8 Mountain Lion Developer Preview

Trying to make my Ruby environment happy under OS X 10.8 Mountain Lion

A few notes. I had:

  • installed XCode 2.4 Preview as well as its command line tools (which are found separately in Preferences -> Downloads)
  • updated rvm (rvm get latest)

and my issue was:

  • system ruby installed every gem with native extensions I threw at it
function saveImage(canvasId) {
var canvas = document.getElementById(canvasId);
var dataUrl = canvas.toDataURL("image/png");
return dataUrl;
}
// example
// <canvas id="myCanvas" />
var imageUrl = saveImage('myCanvas');
@rockinghelvetica
rockinghelvetica / jquery.fixbaselines.js
Created March 18, 2011 06:08
Fix broken baseline alignment in Webkit when using multiple columns.
/*
* Fix baseline alignment in Webkit for CSS3 columns.
* Copyright 2011 Nicholas Macias
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function($){
@rpavlik
rpavlik / fix_homebrew.rb
Created January 6, 2011 20:32 — forked from mxcl/install_homebrew.markdown
Fix permissions on /usr/local for Homebrew
#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
@okal
okal / tropo.php
Created January 4, 2011 14:20
Using Tropo Scripting API from the server with PHP and Curl
<?php
$url = "http://api.tropo.com/1.0/sessions?action=create&token=YOUR_TOKEN_HERE";//You can pass more parameters just as shown in the Quickstart guide.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "username:password");
$xmlResponse = curl_exec($ch);
curl_close ($ch);
echo $xmlResponse; //So you can see the results from your browser when you access this script
?>