Skip to content

Instantly share code, notes, and snippets.

View browniefed's full-sized avatar
🎧
Building

Jason Brown browniefed

🎧
Building
View GitHub Profile
@codahale
codahale / pom.xml
Last active April 20, 2024 01:38
Take this and save it as pom.xml in your project directory.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!-- none yet -->
@domenic
domenic / q-mongoose-so.js
Last active August 24, 2017 05:49
Q + Mongoose from StackOverflow
var mongoose = require('mongoose');
mongoose.connect('mongo://localhost/test');
var conn = mongoose.connection;
var users = conn.collection('users');
var channels = conn.collection('channels');
var articles = conn.collection('articles');
var insertUsers = Q.nfbind(users.insert.bind(users));
var insertChannels = Q.nfbind(channels.insert.bind(channels));
@creationix
creationix / await.js
Last active December 15, 2015 16:49
await wrapper using node-fibers
var Fiber = require("fibers");
module.exports = await;
function await(continuation) {
var fiber = Fiber.current;
var result;
var async;
continuation(function (err, value) {
if (async === undefined) {
async = false;
anonymous
anonymous / gist:5408921
Created April 18, 2013 00:33
(function (window, app, undefined) {
'use strict';
app.factory('socket', ['$rootScope', function ($rootScope) {
var socket = $rootScope.socket;
var onCallback = function (callback, args) {
$rootScope.$apply(function () {
callback.apply(socket, args);
anonymous
anonymous / gist:5408941
Created April 18, 2013 00:37
// Make sure the socket is coming from our app by matching the session id
socketServer.set('authorization', function (data, accept) {
cookieParser(data, {}, function(err) {
if (err) {
accept(err, false);
} else {
config.sessionStore.load(data.signedCookies[config.sessionKey], function(err, session) {
if (err || !session) {
accept('Session error', false);
} else {
@max-mapper
max-mapper / readme.md
Last active October 20, 2020 03:21
node modules for converting PDFs into other formats
@chenglou
chenglou / gist:40b75d820123a9ed53d8
Last active March 13, 2024 12:14
Thoughts on Animation

Interesting part (unmounting & API) is at the end if you're not interested in the rest =).

Stress Tests

This animation proposal is just an attempt. In case it doesn't work out, I've gathered a few examples that can test the power of a future animation system.

  1. Parent is an infinitely spinning ball, and has a child ball that is also spinning. Clicking on the parent causes child to reverse spinning direction. This tests the ability of the animation system to compose animation, not in the sense of applying multiple interpolations to one or more variables passed onto the child (this should be trivial), but in the sense that the parent's constantly updating at the same time as the child, and has to ensure that it passes the animation commands correctly to it. This also tests that we can still intercept these animations (the clicking) and immediately change their configuration instead of queueing them.

  2. Typing letters and let them fly in concurrently. This tests concurrency, coordination of an array of ch

@endolith
endolith / output.png
Last active April 18, 2024 04:22
Detecting rotation and line spacing of image of page of text using Radon transform
output.png

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).