Skip to content

Instantly share code, notes, and snippets.

View shinzui's full-sized avatar
👨‍💻

Nadeem Bitar shinzui

👨‍💻
  • Los Angeles / San Francisco
  • X @shinzui
View GitHub Profile
# Throttled Input event
#
#= provides throttled:input
#
#= require jquery
#
# Delays firing `input` event until user is done typing.
#
# ### Events
#
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []
env = (function() {
var flags = {}, ua = navigator.userAgent, el = document.createElement('div'), video = document.createElement('video'), audio = document.createElement('audio'), root = document.documentElement, i
function flag(names) {
names = names.split(' ')
for (i = 0; i < names.length; i++)
flags[names[i]] = true
}
function classnames() {
var names = [], name
for(name in flags) if (flags.hasOwnProperty(name))
@shinzui
shinzui / introrx.md
Last active August 29, 2015 14:10 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

Using Homebrew to manage Node.js and io.js installs on OSX

Having both Node.js and io.js installed with NVM was giving me a load of problems, mainly with npm. So I uninstalled NVM and manage Node.js and io.js with homebrew.
Heres how.

Install Node.js and io.js

$ brew install node
$ brew install iojs

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)

Keybase proof

I hereby claim:

  • I am shinzui on github.
  • I am shinzui (https://keybase.io/shinzui) on keybase.
  • I have a public key whose fingerprint is 02B1 5943 1DE8 7768 7E68 6AC6 F621 9CC5 A447 F453

To claim this, I am signing this object:

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

@shinzui
shinzui / README.md
Last active August 29, 2015 14:27 — forked from HenrikJoreteg/README.md
Minimalist routing in Redux

Why would you want to do this? Because you often don't need more. It's nice to not have to think about your "router" as this big special thing.

Instead, with this approch, your app's current pathname is just another piece of state, just like anything else.

This also means that when doing server-side rendering of a redux app, you can just do:

var app = require('your/redux/app')
var React = require('react')
@shinzui
shinzui / gist:11202
Created September 17, 2008 06:01 — forked from al3x/al3x_ubiquity.js
CmdUtils.CreateCommand({
name: "bitly",
takes: {"url to shorten": noun_arb_text},
preview: "Replaces the selected URL with a bit.ly-shortened URL.",
description: "Replaces the selected URL with a bit.ly-shortened URL.",
icon: "http://bit.ly/favicon.png",
execute: function( urlToShorten ) {
var baseUrl = "http://bit.ly/api";
var params = {url: urlToShorten.text};
jQuery.get(baseUrl, params, function(shortenedUrl) {