Skip to content

Instantly share code, notes, and snippets.

View rjz's full-sized avatar
👋
Hey there!

RJ Zaworski rjz

👋
Hey there!
View GitHub Profile
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@rjz
rjz / cs-jq-plugin-template.coffee
Created September 3, 2012 17:01
Coffeescript jQuery Plugin Class Template
# A class-based template for jQuery plugins in Coffeescript
#
# $('.target').myPlugin({ paramA: 'not-foo' });
# $('.target').myPlugin('myMethod', 'Hello, world');
#
# Check out Alan Hogan's original jQuery plugin template:
# https://github.com/alanhogan/Coffeescript-jQuery-Plugin-Template
#
(($, window) ->
@rjz
rjz / routes.rb
Created September 13, 2012 00:49
Rails catch-all routes with Jasminerice
My::Application.routes.draw do
# Include route definitions here
# ...
# Delegate +/jasmine+ routes to Jasminerice in development only
# see: https://github.com/bradphelan/jasminerice/blob/master/config/routes.rb
if Rails.env.development?
mount Jasminerice::Engine => '/jasmine'
@rjz
rjz / formtastic.rb
Created November 20, 2012 01:09
Side-by-side fields for formtastic-bootstrap
# config/initializers/formtastic.rb
module FormtasticBootstrap
class FormBuilder < Formtastic::FormBuilder
# Allow "split-field" inputs such as name (first+last) or location (city+state).
# Block contents are wrapped in a ".controls" field set next to the specified
# +label+
#
# Usage:
#

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@rjz
rjz / ternary.coffee
Created March 14, 2014 00:33
CoffeeScript ternaries
# Docco must have missed the `0&+` operator...
e = ['truthiness', 'falsitude'][0&+false]
console.log e
@rjz
rjz / nvcexploder-noderoad-pdx.md
Created March 21, 2014 02:48
Notes from Ben Acker's talk at #noderoad PDX

Ben Acker (@nvcexploder / Walmart) - Node in Production

  • Impetus: Walmart wanted a mobile presence. They built an application that looked like it was created by a giant retail operation--SOAP services, etc.
  • Started looking for other options: native apps,
  • Started with services team (worked on original app, spinning out to other mobile apps)--all of a sudden had loads of different clients consuming the services. Converting old soap/XML into something mobile-friendly?
  • High volume days (black Friday) start taking services down, and services team already distracted by mobile projects
  • Time to start building better services
  • Brought Eran Hammer over from Yahoo and gave him the go-ahead to use anything he wanted to improve mobile services. He chose node.
  • Walmart's been open-source from the start
  • But how to maintain legacy services?
@antonmedv
antonmedv / Flyspeck.js
Last active November 26, 2019 07:01
Simple and Small Dependency Injection Container inspired by Pimple.
/*
* Flyspeck is Dependency Injection Container.
*
* Copyright (c) 2014 Anton Medvedev
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is furnished
@rjz
rjz / getflow.sh
Last active August 29, 2015 14:10
Linux installer for flow
#!/bin/sh
# Linux x64 install for Facebook's flow JS type checker (flowtype.org). Flow
# will be installed to the local directory, replacing any previous versions
# placed here by this script.
ZIP=flow-linux64-latest.zip
URL=http://flowtype.org/downloads/$ZIP
BINDIR=flow
@gr0uch
gr0uch / errors.js
Last active August 29, 2015 14:14
Custom typed errors in ES6
// Hello. There is now a module for this.
// https://github.com/0x8890/error-class
// $ npm install error-class
const hasCaptureStackTrace = 'captureStackTrace' in Error
// Internal function to set up an error.
function setup (message) {
const { constructor, constructor: { name } } = this