An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| var net = require('net'), | |
| sys = require('sys'); | |
| function WSServer(port, ip) { | |
| if(!port) throw('You should assign a port to listen.'); | |
| this.port = port; | |
| this.ip = ip||'127.0.0.1'; | |
| this.server = null; | |
| var clients = {}; | |
| var state = { |
| // ==UserScript== | |
| // @name Use Markdown, sometimes, in your HTML. | |
| // @author Paul Irish <http://paulirish.com/> | |
| // @link http://git.io/data-markdown | |
| // @match * | |
| // ==/UserScript== | |
| // If you're not using this as a userscript just delete from this line up. It's cool, homey. |
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.| void function() {//closure | |
| var global = this | |
| , _initKeyboardEvent_type = (function( e ) { | |
| try { | |
| e.initKeyboardEvent( | |
| "keyup" // in DOMString typeArg | |
| , false // in boolean canBubbleArg | |
| , false // in boolean cancelableArg | |
| , global // in views::AbstractView viewArg |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| local exosite = require 'exosite' | |
| local json = require 'dkjson' | |
| local exo = exosite.rpc:new{cik = "9829879a04efb8f4a1b42e22245739678fd4a94e"} | |
| local status, response = exo:create{ | |
| "dataport", | |
| { | |
| format = "float", | |
| name = "Temperature", |
| local oneprpc = require 'oneprpc' | |
| local json = require 'json' | |
| local rpc = oneprpc:new({cik = "9829879a04efb8f4a1b42e22245739678fd4a94e"}) | |
| local status, rid = rpc.create( | |
| "dataport", | |
| { | |
| format = "float", | |
| name = "Temperature", |
| query IntrospectionQuery { | |
| __schema { | |
| queryType { name } | |
| mutationType { name } | |
| subscriptionType { name } | |
| types { | |
| ...FullType | |
| } | |
| directives { |