Skip to content

Instantly share code, notes, and snippets.

@ppk asks: “OK, suggestions for my next bit of research?” — https://twitter.com/ppk/status/587545743625478144

@rem replies: “@ppk storage. What works in browser, what browsers, what phones, how it changes when *added to home screen", limits, etc. How's that?” — https://twitter.com/rem/status/587566978065367040

Here’s what I whipped up, please add more in the comments:

APIs:

{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@karlwestin
karlwestin / About.md
Created June 30, 2015 16:29
Porting the erlang checkpoint comparison to JS

Porting CouchDB checkPoints from erlang to javascript

This is an attempt to implement CouchDB checkpoint comparison for PouchDB, to be able to pick up interrupted replications even though checkpoint writing is in an unknown state. Mismatching checkpoints causes replication to start over from change 0

This gist is a request for comments from people familiar with both JS and Erlang, to see if they are functionally identical

@biovisualize
biovisualize / index.html
Created September 17, 2011 01:38
Brush selection on a table
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<style type="text/css">
#table{
position: absolute;
}
#viz{
position: absolute;
@rnewson
rnewson / gist:dbe91d7beea3cf928e09
Last active December 8, 2016 18:29
notes on rPI PIA VPN
# fresh raspbian image
# I'm using the Edimax EW-7811UN (http://www.amazon.co.uk/gp/product/B003MTTJOY)
# which requires a custom hostapd. I expect there are better options now that Just Work.
# Initial setup
expand partition
expand filesystem
memory split to 32
configure sshd to publickey only (and add your key...)
@jefbarn
jefbarn / my_code.js
Created February 11, 2017 19:37
Using Pouchdb _selector plug-in
import PouchDB from 'pouchdb-browser' // Or however you are importing PouchDB using your module system
PouchDB.plugin((PouchDB) => { // Add the 'plug-in' to the Pouchdb instance
let pouchReplicate = PouchDB.replicate
PouchDB.replicate = (source, target, repOptions) => {
let sourceAjax = source._ajax
source._ajax = (ajaxOps, callback) => {
if (ajaxOps.url.includes('_selector')) {
@nolanlawson
nolanlawson / differences.md
Last active June 19, 2017 18:57
Differences between Progressive Web Apps and old-school offline webapps

Progressive Web App stack:

  • Service Worker
  • Web App Manifest

Old-school offline webapp stack:

  • Application Cache
  • Touch Icons (apple-touch-icon etc.)
  • apple-mobile-web-app-capable or mobile-web-app-capable
@jasondavies
jasondavies / index.html
Created September 10, 2012 08:33
longscroll.js
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.longscroll {
overflow-y: auto;
width: 480px;
height: 500px;
float: left;
}
.longscroll .row {
@varjmes
varjmes / blob.js
Last active March 31, 2019 10:39
Creating the tree!
class Blob {
constructor(data) {
this.data = data
}
type() {
return 'blob'
}
toString() {
* SimpleMDE - https://simplemde.com/
Broken in various ways, abandoned and carried on in a fork by ...
* EasyMDE - https://easymde.tk/
Based on codemirror, works quite nicely (not sure about the link formatting yet) but
completely broken on mobile, codemirror is doing a big v6 that will hopefully fix
mobile support, but probably gonna be a while coming
* Slate / slate-md-editor - https://canner.github.io/canner-slate-editor/?selectedKind=slate-md-editor&selectedStory=Simple%20demo&full=0&addons=1&stories=1&panelRight=0
Looks pretty decent but would need to do a whole react setup to be able to use it