Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
// ==UserScript== | |
// @name SlackPGP | |
// @namespace slack | |
// @description slackPGP | |
// @include https://*.slack.com/messages/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
// [B](f: (A) ⇒ [B]): [B] ; Although the types in the arrays aren't strict (: | |
Array.prototype.flatMap = function(lambda) { | |
return Array.prototype.concat.apply([], this.map(lambda)); | |
}; |
/* jshint esnext:true */ | |
/** | |
* "Producer-Consumer" implementation using generators. | |
* @see http://en.wikipedia.org/wiki/Deterministic_concurrency#Comparison_with_generators | |
*/ | |
var SIZE = 3, | |
queue = newQueue(); |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
From Meteor's documentation:
In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.
This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.
Sometimes we need to run async code in Meteor.methods
. For this we create a Future
to block until the async code has finished. This pattern can be seen all over Meteor's own codebase:
var xhr = function() { | |
var xhr = new XMLHttpRequest(); | |
return function( method, url, callback ) { | |
xhr.onreadystatechange = function() { | |
if ( xhr.readyState === 4 ) { | |
callback( xhr.responseText ); | |
} | |
}; | |
xhr.open( method, url ); | |
xhr.send(); |
! {{{ Quick Reference | |
! | |
! Scrolling: | |
! Scroll Wheel | |
! Shift-PgUp/PgDn | |
! | |
! Copy/Paste: | |
! Mouse-Select : Copy to PRIMARY | |
! Shift + Mouse-Select: Copy to CLIPBOARD | |
! |