This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'), | |
request = require('request'), | |
url = require('url'); | |
var port = 8080; | |
var app = express(); | |
app.use(function(req, res, next) { | |
var proxyUrl = req.path.match(/^\/api(.*)$/); | |
if (proxyUrl) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"filterBy": [ | |
{ "property": "id", "type": "num" }, | |
{ "property": "name", "type": "string"} | |
], | |
"data": [ | |
{ | |
"id": 1, | |
"name": "tphilyaw", | |
"firstName": "tommy", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern mod extra; | |
use extra::arc::Arc; | |
fn main() { | |
let x = ~5; | |
let y = Arc::new(x); // x is no longer pointer to ~5, and y points to the pointer x was that is not to the value but the | |
// but the pointer x held. | |
let z = y.clone(); // same semantics, the clone produces a pointer to the pointer x was. | |
println!("{}", **(y.get())); // see we have that double reference we have to deref twice. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fmt; | |
struct Name { | |
first: ~str, | |
last: ~str | |
} | |
// I'm printing a string here, but | |
// in reality this could be binary output | |
impl fmt::Binary for Name { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// these two are taken from the docs | |
struct Point { | |
x: f64, | |
y: f64 | |
} | |
// They use shape later in the docs to show pattern matching | |
// but I'm going to attempt to explain it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define("app/templates/application", ["exports"], function(__exports__){ __exports__["default"] = function anonymous(Handlebars,depth0,helpers,partials,data) { | |
this.compilerInfo = [4,'>= 1.0.0']; | |
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {}; | |
var buffer = '', stack1, helper, options, self=this, helperMissing=helpers.helperMissing; | |
function program1(depth0,data) { | |
data.buffer.push("Builder"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
speed = 500 | |
angle = -200 | |
# being very explicit here, I believe the default | |
# unit is 8, and the endianess is big | |
# | |
# So I do need to pack this message in particular way according to the | |
# specs for the roomba serial interface, which is the like this | |
# | |
# command [optional bytes] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Maybe | |
{ | |
interface Maybe<T> | |
{ | |
T Value(); | |
bool HasValue(); | |
Maybe<T> Bind(Func<T, Maybe<T>> f); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
type Maybe<'a> = | |
| Just of 'a | |
| Nothing | |
let Unit (x: 'a) : Maybe<'a> = | |
Just x | |
let Bind (f: 'a -> Maybe<'b>) (mx: Maybe<'a>) = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Maybe | |
{ | |
abstract class Maybe<T> { | |
public static Maybe<T> Return(T val) | |
{ | |
return new Just<T> (val); | |
} |
OlderNewer