// jQuery
$(document).ready(function() {
// code
})
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 remote source deletes a bunch of data,
Finds PNG images in the source
folder, and saves corresponding thumbnails to the target
folder.
Use with gistup to create gists (and blocks) from the command line. The directory containing your gist files gets initialized as a git repo. See this tutorial for a quick overview.
For additional tips on generating block thumbnails, see this HOWTO.
View live on RequireBin.
A few examples to peruse after reading Peter Bourgon's awesome tutorial, which walks you through the building of a backend service for a web app.
- another example - a simple web server and client
- writing web apps - go's official tutorial
- recap of request handling - overview of go's request routing and response handling mechanics
What kind of iteration to use when in JavaScript?
for (var i = 0; i < array.length; i++) {
}
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Includes HTTP-Header information in the output
from cssutils import profile | |
from cssutils.profiles import Profiles, properties, macros | |
#patch um up | |
properties[Profiles.CSS_LEVEL_2]['-ms-interpolation-mode'] = r'none|bicubic|nearest-neighbor' | |
properties[Profiles.CSS_LEVEL_2]['-ms-text-size-adjust'] = r'none|auto|{percentage}' | |
properties[Profiles.CSS_LEVEL_2]['mso-table-lspace'] = r'0|{num}(pt)' | |
properties[Profiles.CSS_LEVEL_2]['mso-table-rspace'] = r'0|{num}(pt)' | |
properties[Profiles.CSS_LEVEL_2]['-webkit-text-size-adjust'] = r'none|auto|{percentage}' | |
#re-add | |
profile.addProfiles([(Profiles.CSS_LEVEL_2, |
'use strict'; | |
const statusCodes = require('http').STATUS_CODES; | |
function createError(code, name) { | |
return function(message) { | |
Error.captureStackTrace(this, this.constructor); | |
this.name = name; | |
this.message = message; | |
this.statusCode = code; | |
} |