For use on:
https://console.aws.amazon.com/s3/home
Only tested in Chrome.
Installation instructions:
- View > Always Show Bookmarks Bar.
var cluster = require('cluster'); | |
var http = require('http'); | |
var numCPUs = require('os').cpus().length; | |
var pid = process.pid; | |
var port = process.env['PORT'] || 8000; | |
if (cluster.isMaster) { | |
console.log('Master:', pid); | |
// Fork workers -- one less than the number of CPUs. |
--- | |
title: 500 Internal Server Error | |
--- | |
<article> | |
<h1>500 Internal Server Error</h1> | |
<p> | |
Sorry, something’s gone wrong on our end. | |
We apologize for the inconvenience. | |
</p> |
express = require 'express' | |
app = express() | |
# the list of all messages we've received: | |
messages = [] | |
# a map from all the clients we've seen (by their IDs), | |
# to their next unseen messages (by the messages' indices): | |
clients = {} |
For use on:
https://console.aws.amazon.com/s3/home
Only tested in Chrome.
Installation instructions:
# | |
# Overloads: | |
# - fetch(url, callback) | |
# - fetch(url, opts, callback) | |
# | |
fetch = (args...) -> | |
[arg0, arg1, arg2] = args | |
[url, opts, callback] = switch args.length | |
when 0, 1 then throw new Error "Usage: fetch(url[, opts], callback)" | |
when 2 then [arg0, null, arg1] |
javascript:(function(){[].forEach.call(document.querySelectorAll('.discussion-item-toggle-closed'), (elmt) => elmt.click())})(); |
One of CoffeeScript's best features is the @
shorthand for this
-- perfect for accessing instance methods and properties:
class Rectangle
constructor: (@width, @height) ->
getArea: ->
@width * @height
But there's no similar shorthand for accessing static members, e.g. @@
. So instead, you're forced to either hardcode class names, or type out the long constructor
reference to be generic:
express = require 'express' | |
app = express.createServer() | |
# ... | |
module.exports = app |
import java.util.Map; | |
import java.util.HashMap; | |
import com.joyent.node.http; | |
import com.joyent.node.http.RequestListener; | |
import com.joyent.node.http.ServerRequest; | |
import com.joyent.node.http.ServerResponse; | |
public class HelloNode { | |
public static void main(string[] args) { |
$ http -v PUT localhost:5100 Expect:100-continue foo=bar | |
PUT / HTTP/1.1 | |
Accept-Encoding: identity, deflate, compress, gzip | |
Accept: application/json | |
User-Agent: HTTPie/0.2.5 | |
Host: localhost:5100 | |
Expect: 100-continue | |
Content-Type: application/json; charset=utf-8 |