Skip to content

Instantly share code, notes, and snippets.

Hi Zach :D

Modals are funny beasts, usually they are a design cop-out, but that's okay, designers have to make trade-offs too, give 'em a break.

First things first, I'm not sure there is such thing as a "simple" modal that is production ready. Certainly there have been times in my career I tossed out other people's "overly complex solutions" because I simply didn't understand the scope of the problem, and I have always loved it when people who have a branch of experience that I don't take the time

@cowboyd
cowboyd / mutable-collection.js
Created March 26, 2015 14:59
Present a mutable interface to an immutable array and track changes in realtime
import Ember from 'ember';
/**
* Presents a mutable interface to an immutable array.
*
* As you make changes to the array, it tracks which objects are new,
* which objects have been removed, and which objects were in the
* original array. To use an instance of this class, set the
* `original` property to an array. This array will not be touched as
* you make changes via the mutable interface. E.g.
@Micka33
Micka33 / install.md
Last active March 17, 2022 10:55
cassandra on mac OSX

Installing Cassandra on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
var If = React.createClass({
render: function() {
return this.props.value && this.props.children;
}
});
// usage
<If value={this.state.whatever}>
Stuff
</If>
/** @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,
@jgwhite
jgwhite / setup.js
Last active August 29, 2015 14:06
Report Ember.js routing errors in QUnit output
// By default errors thrown in route hooks log to the console.
// The router then gracefully transitions to the error substate.
// In tests we’d rather see these errors reported in QUnit’s output.
// Implementing this is easy and here’s how...
// In app/routes/application.js add:
export default Ember.Route.extend({
actions: {
error: function(error) {
@staltz
staltz / introrx.md
Last active May 6, 2024 01:44
The introduction to Reactive Programming you've been missing
@simenbrekken
simenbrekken / context.js
Created April 24, 2014 12:48
Manipulating React immutable stores with context
var Application = React.createClass({
childContextTypes: {
createProduct: React.PropTypes.func
},
getChildContext: function() {
return {
createProduct: this.createProduct
}
},
/* Put your CSS here */
html, body {
margin: 20px;
}
input: {
padding: 8px;
border-radius: 4px;
}
.color-swatch {
static OSStatus
SSLVerifySignedServerKeyExchange(SSLContext *ctx, bool isRsa, SSLBuffer signedParams,
uint8_t *signature, UInt16 signatureLen)
{
OSStatus err;
SSLBuffer hashOut, hashCtx, clientRandom, serverRandom;
uint8_t hashes[SSL_SHA1_DIGEST_LEN + SSL_MD5_DIGEST_LEN];
SSLBuffer signedHashes;
uint8_t *dataToSign;
size_t dataToSignLen;