Skip to content

Instantly share code, notes, and snippets.

* 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
@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() {
@zed-dz
zed-dz / offline_mdn_docs.md
Created March 12, 2019 14:01
Offline MDN Docs
@adactio
adactio / minimal-serviceworker.js
Last active August 18, 2023 09:15
An attempt at a minimal viable service worker.
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
// HTML files: try the network first, then the cache.
// Other files: try the cache first, then the network.
// Both: cache a fresh version if possible.
// (beware: the cache will grow and grow; there's no cleanup)
const cacheName = 'files';
@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
@zhaohuanltbl
zhaohuanltbl / ngx-lua.sh
Created November 11, 2015 02:24 — forked from Ryan4CN/ngx-lua.sh
Script to compile nginx on ubuntu with lua support.
#!/bin/sh
apt-get install -y libreadline-dev libncurses5-dev libpcre3-dev \
libssl-dev perl make build-essential
# Script to compile nginx on ubuntu with lua support.
NGX_VERSION='1.8.0'
LUAJIT_VERSION='2.0.4'
LUAJIT_MAJOR_VERSION='2.0'
@colinmahns
colinmahns / otrdm.md
Last active March 31, 2021 19:33
HOWTO: Twitter DM with OTR

Twitter DM + OTR: A quick and dirty tutorial

With the recent removal of the 140-character limit in Direct Messages by Twitter, DM's have now become a much more useful platform for communicating between individuals and groups. Sadly, DM's are still sent in plaintext between users and Twitter has no plans currently on encrypting these messages, at least as of August 2015. Since these are stored in plaintext at rest, an adversary can see the content of the message you are sending, which the two parties might not wish to happen. Fortunately as a few applications with basic Twitter support which also have excellent support for OTR, all hope isn't lo

@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

{
"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",