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
@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?
@rjz
rjz / notes.md
Last active August 29, 2015 13:57
Notes from Nick Desaulniers on Convergence of the Browser and the OS

Convergence of the Browser and OS

Nick Desaulniers (Open Source @ Mozilla)

  • [What does "Open Source" mean to me?][1]

What would a desktop environment look like if it were implemented entirely in a browser?

// require hogan
var hogan = require("hogan.js");
// compile template
var template = hogan.compile("@{{name}}");
var team = ['dhg', 'fat', 'jimio', 'nickgreen', 'sayrer'];
var mappedTeam = team.map(function (twitterer) {
@rjz
rjz / mysql-timestamp-to-js-date.md
Created May 20, 2014 16:53
Mysql Timestamp to JavaScript date

First, select the TIMESTAMP column as a UNIX_TIMESTAMP:

// in model
exports.find = function find (id, callback) {
  var sql = 'SELECT event, UNIX_TIMESTAMP(`time`) as time FROM events WHERE id = ?';
  return db.query(sql, [id], callback);
};

Then build a new Date from the timestamp:

@rjz
rjz / temporary.md
Created June 5, 2014 22:32
Temporary git branches FTW
rj:project$ git branch -D asdkljasdjlj                                 
Deleted branch asdkljasdjlj (was a9384f0).
@rjz
rjz / notes.md
Created June 10, 2014 03:02
Growing user generated content with content translation tools in Wikipedia

Growing user generated content with content translation tools in Wikipedia

Alolita Sharma (@alolita) Director of Engineering for Internationalization and Localization at Wikipedia https://twitter.com/alolita

Meetup: @sfglobalization

Wikipedia

@rjz
rjz / methods.md
Created June 10, 2014 14:07
Underscore methods used in Backbone

For backbone 1.1.2:

$ grep '_\.[^(]*(' backbone.js | cut -d_ -f2 | cut -d'(' -f1 | grep '\.' | sort | uniq
.any
.bind
.bindAll
.clone
.defaults
.each
@rjz
rjz / backbone-models-and-other-views.md
Last active August 29, 2015 14:02
Backbone with other view libraries
@rjz
rjz / widthifier.vim
Created June 20, 2014 15:51
Vim text-wrapping and border
" Set text wrapping at the specified column
function Widthifier(col)
let &l:textwidth=a:col
let &l:colorcolumn=a:col+1
let &l:tw=a:col
endfunction
" line @ 80 chars for js/coffee files
autocmd bufreadpre *.js call Widthifier(80)
autocmd bufreadpre *.coffee call Widthifier(80)