Skip to content

Instantly share code, notes, and snippets.

View junosuarez's full-sized avatar
💭
hi hello

juno suárez junosuarez

💭
hi hello
View GitHub Profile
$ sudo yum update
$ sudo yum install openssl-devel
$ sudo yum install gcc-c++
$ wget -c http://znc.in/releases/znc-latest.tar.gz
$ tar -xzvf znc-latest.tar.gz
$ cd znc*
$ ./configure
$ make
$ sudo make install
@jlongster
jlongster / gist:3881008
Created October 12, 2012 19:28
js destructuring macro
// Note: there are bugs in hygienic renaming, so this doesn't work all the time yet.
macro varr {
case [$var (,) ...] = $expr => {
var i = 0;
var arr = $expr;
$(var $var = arr[i++];) ...
}
@max-mapper
max-mapper / index.js
Created November 27, 2012 01:28
link to lat/lon in native maps app on ios and android from webview (phonegap)
var mapLink = "http://maps.google.com/maps?z=12&t=m&q=loc:" + lat + "+" + lon
if ($.os.ios && navigator.userAgent.match(/iPhone OS 6_/)) mapLink = "Maps://?q=" + lat + "," + lon
if ($.os.android) mapLink = "geo:" + lat + "," + lon + "?z=12&q=" + lat + "," + lon
// assumes you have zepto and zepto.detect loaded
// also you should use target=_blank on your <a> tags
@max-mapper
max-mapper / readme.md
Last active December 13, 2015 23:39
node + npm explanation from #voxel.js irc

21:57 < dook> You seem to be new to node, is that right?

21:57 < skidz> good to know... yes.. very

21:57 < skidz> but familar with JS but mostly a C# programmer

21:58 < dook> Ok so the basic premise is that to make Chrome run javascript fast, they made a JS->C++ compiler called V8

21:58 < dook> It makes JS compile into very fast, efficient code.

@wycats
wycats / promises.js
Last active December 15, 2015 15:09
// This is just an example of nested callbacks. I know you could achieve this
// goal with simpler code but I'm just showing an example
// The well-known callback pattern
fs.mkdir("some-path", function(err) {
fs.open("some-path/file", "w", function(err, fd) {
var buffer = new Buffer("hello world");
fs.write(fd, buffer, 0, buffer.length, null, function(err, bytes) {
console.log("Wrote " + bytes + " bytes");
@dominictarr
dominictarr / level-atomic-data.js
Last active December 17, 2015 05:39
level-atomic-data
//datomic clone
var log = db.sublevel('log')
var audit = db.sublevel('audit')
//var sha1sum = require('sha1sum')
//initialize current sha
db.pre(function (op, add) {
var ts = timestamp() //or get timestamp from a transactor service
//save this value at this timestamp.
add({
@othiym23
othiym23 / yay-area-node-meetup-proposal.md
Last active December 28, 2015 06:09
How make better Bay Area Node meetups?

Goals

  1. Capture some of the benefit of NodeConf, JSConf or RealTimeConf on a sustainable, regular basis.
  2. Get enough of a quorum of Bay Area Node.js leadership involved to appeal to other people to attend and get involved themselves. This includes not just visible leadership, but valuable less-visible contributors like jlord, Dave Pacheco, Emily Tanaka-Delgado, and Daniel Erickson.
  3. Provide an in-person forum to work through Node issues and improve and broaden the community.
  4. Foster broader leadership by getting more people more involved.
  5. Spread the organizational load among a wider crew of people so no one individual gets burnt out, more people get experience with running events, and we all are able to have fun.
  6. If there is to be a bias when making speaker selections, have it be towards bringing in new speakers and creating a safe space for speakers to present new material.
  7. Keep it fast-moving, entertaining, and concise -- have 2-hour (tops) meetups and then allow people to do social s
;; based on http://talks.golang.org/2012/concurrency.slide#50
(ns robpike
(:require [cljs.core.async :as async :refer [<! >! chan close!]])
(:require-macros [cljs.core.async.macros :as m :refer [go alt!]]))
(defn timeout [ms]
(let [c (chan)]
(js/setTimeout (fn [] (close! c)) ms)
c))
@PhillyCDO
PhillyCDO / philly-open-data-order.md
Created September 4, 2012 17:08
Open Data Executive Order for the City of Philadelphia

OPEN DATA AND GOVERNMENT TRANSPARENCY

WHEREAS, the City of Philadelphia is committed to creating a high level of openness and transparency in government; and

WHEREAS, the three principles of transparency, participation, and collaboration form the cornerstone of an open government; and

WHEREAS, the City’s participation as a founding and vital partner in the open data consortium has provided a model for transparency on which the City should continue to build; and

WHEREAS, more City data sets should be published and made available via an Open Data Portal which will provide access to information and a mechanism for public feedback and participation; and

@max-mapper
max-mapper / readme.md
Created September 28, 2011 02:01
SLEEP - syncable.org

Your API does REST, but can it SLEEP?

SLEEP (Syncable Lightweight Event Emitting Persistence) is an emerging standard for distributed data sync using HTTP and JSON. A generalized version of CouchDB's much lauded built-in replication, SLEEP extends the REST architecture to define a way in which databases can offer syncable JSON APIs that foster open data innovation by allowing developers to replicate entire databases over the net.


SLEEP comes from the Apache CouchDB project which is now widely known for it's multi-master streaming HTTP + JSON replication. This is possible in part because of the CouchDB _changes feed, which is a particular API that lets you see if there have been any changes made to the database since last time you synchronized. CouchDB can efficiently implement the _changes feed because of one subtle difference between it and most other databases: it stores a history of all changes that happen to the database, including deletes.

If you synchronize data from a remote source and then the