Skip to content

Instantly share code, notes, and snippets.

View redgeoff's full-sized avatar

Geoff Cox redgeoff

View GitHub Profile
@redgeoff
redgeoff / index.html
Created July 29, 2014 12:55
Partial updates using pouch and the every-doc-is-a-delta pattern
<html>
<body>
<script src="//cdnjs.cloudflare.com/ajax/libs/pouchdb/2.2.3/pouchdb.min.js"></script>
<script>
function merge(obj1, obj2) {
for (var i in obj2) {
obj1[i] = obj2[i];
}
}
@redgeoff
redgeoff / index.html
Created August 15, 2014 06:04
pouchdb-bad-remove-promise
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="//cdn.jsdelivr.net/pouchdb/2.2.3/pouchdb.min.js"></script>
</head>
<body>
@redgeoff
redgeoff / index.html
Created August 15, 2014 15:18
pouchdb-bad-remove-promise-fix
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="//cdn.jsdelivr.net/pouchdb/2.2.3/pouchdb.min.js"></script>
</head>
<body>
@redgeoff
redgeoff / index.html
Last active August 29, 2015 14:05
bluebird-chain-promises
<html>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/1.2.2/bluebird.js"></script>
<script>
function setTimeoutPromise(ms) {
return new Promise(function (resolve) {
setTimeout(resolve, ms);
});
@redgeoff
redgeoff / Angular-Inheritance.markdown
Created August 19, 2014 07:27
A Pen by Geoff Cox.
@redgeoff
redgeoff / index.html
Last active August 29, 2015 14:06
PouchDB - destroy not deleting couch database
<!doctype html>
<html>
<head>
<script src="//cdn.jsdelivr.net/pouchdb/3.0.5/pouchdb.min.js"></script>
</head>
<body>
<script>
var db = new PouchDB('test_destroy'),
remoteCouch = 'http://127.0.0.1:5984/test_destroy',
opts = { live: true };
@redgeoff
redgeoff / index.html
Last active August 29, 2015 14:07
PouchDB Chatty
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="//cdn.jsdelivr.net/pouchdb/3.0.5/pouchdb.js"></script>
</head>
@redgeoff
redgeoff / index.html
Created October 20, 2014 00:01
Pouch Retry
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="pouchdb.master.js"></script>
</head>
<body>
@redgeoff
redgeoff / tin-npm
Last active August 29, 2015 14:07
tin-npm
#!/bin/sh
ver=$1
if [ -z "$ver" ]
then
echo 'usage: tin-npm version'
exit
fi
@redgeoff
redgeoff / tin-grunt
Last active August 29, 2015 14:08
tin-grunt
#!/bin/sh
ver=$1
if [ -z "$ver" ]
then
echo 'usage: tin-grunt version'
exit
fi