Skip to content

Instantly share code, notes, and snippets.

View dscape's full-sized avatar

Nuno Job dscape

View GitHub Profile

Overview

PouchDB is a database written in JavaScript for web browsers that has in built sync capabilities.

For a long time 'web' was synonymous with 'online'. That is no longer the case, Mobile web usage is set to overtake desktop web usage shortly and a growing number of examples are showing that web technology is capable of handling the type of applications that were traditionally built using desktop native technology.

The new wave of offline web applications are going to need somewhere to store their data and they are going to need to learn how to move that data around as their user moves from device to device. How about we build a database with that functionality built in?

Objective

@dscape
dscape / couchdb-in-joyent-smart-os.md
Created January 4, 2013 12:14
Installing CouchDB In Joyent Cloud SmartOS

Simple:

pkgin in couchdb

Done.

@dscape
dscape / stud
Last active January 5, 2016 23:49 — forked from ghcopy/stud
#!/bin/sh
### BEGIN INIT INFO
# Provides: stud
# Required-Start: $remote_fs $network $local_fs
# Required-Stop: $remote_fs $network $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: The Scalable TLS Unwrapping Daemon
# Description: stud is a network proxy that terminates TLS/SSL

Debugging

  • node-inspector
  • brackets
  • node debug
  • console.log
  • dtrace
  • systap
  • repl
var five = require('johnny-five'),
foldl = require('./hof').foldl
var leds =
[ 2
, 3
, 4
, 5
, 6
, 7
@dscape
dscape / fetch.sh
Created July 19, 2013 21:22 — forked from mmalecki/fetch.sh
#!/bin/sh
username=$1
git remote -v | grep "$username"
if [ $? -ne 0 ]; then
project=`git ls-remote --get-url | sed 's/.*\/\([a-z]*\).git/\1/g'`
git remote add "$username" "https://github.com/$username/$project.git"
fi
git fetch "$username"
var five = require('johnny-five');
module.exports = function (cb) {
var board = new five.Board();
board.on('ready', function() {
var laser = new five.Led(12)
, onlineLed = new five.Led(13)
, servoX = new five.Servo(10)
, servoY = new five.Servo(9)
var request = require('request')
, location = process.argv[2]
;
if(!location) {
throw new Error('sad panda');
}
request(
@dscape
dscape / js-beautify-and-jshint-for-textmate2.command.sh
Last active December 20, 2015 17:29
A command that on save (command + s) runs the beautifier and then runs jshint according to your jshintrc. if there are jshint errors it adds a comment to shame you into submission. Requires this bundle to actually do the saving https://github.com/bomberstudios/Save-On-Focus-Lost.tmbundle
#!/usr/bin/env bash
#
# Ask the textmate guys?
#
[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
#
# Name: reformat.js
# Author: @dscape
<html>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script>
$.getJSON('http://localhost:3000/athlete/1', function(data) {
console.log(data);
});
</script>
</html>