This file contains hidden or 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 flatiron = require('flatiron'), | |
ecstatic = require('ecstatic'), | |
socketful = require('socketful'), | |
restful = require('restful'), | |
models = require('./models').fixtures; | |
var app = module.exports = flatiron.app; | |
app.use(flatiron.plugins.http, { | |
before: [ |
This file contains hidden or 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
diff --git a/lib/pkgcloud/core/compute/bootstrapper.js b/lib/pkgcloud/core/compute/bootstrapper.js | |
index 819ea80..9b2ffdf 100644 | |
--- a/lib/pkgcloud/core/compute/bootstrapper.js | |
+++ b/lib/pkgcloud/core/compute/bootstrapper.js | |
@@ -171,7 +171,9 @@ Bootstrapper.prototype.createServer = function (options) { | |
if (options.flavorId) { | |
createOptions.flavor = options.flavorId; | |
} | |
- | |
+ if (options.keyname) { |
This file contains hidden or 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
import Graphics.Input as Input | |
import Http | |
import WebSocket | |
import JavaScript.Experimental as JS | |
import Json | |
import Window | |
import Keyboard | |
(nameInput, username) = Input.field "Your name here" |
This file contains hidden or 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
module Expressions where | |
import Text.ParserCombinators.Parsec | |
import Control.Monad | |
import Control.Monad.Error | |
import System.IO | |
data Term a = IntVal Integer | |
| StrVal String | |
| RealVal Double |
This file contains hidden or 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
combine' :: (a -> a -> a) -> Value -> Value -> Value | |
combine' fun (IntVal a) (IntVal b) = IntVal $ fun a b | |
combine' fun (IntVal a) (RealVal b) = RealVal $ fun b $ fromInteger a | |
combine' fun (RealVal a) (IntVal b) = RealVal $ fun a $ fromInteger b | |
combine' fun (RealVal a) (RealVal b) = RealVal $ fun a b | |
--combine' fun (StrVal a) (StrVal b) = StrVal $ fun a b |
This file contains hidden or 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
webbitchat.core=> (defmulti send-multi (fn [msg] (-> msg :action keyword))) | |
nil | |
webbitchat.core=> send-multi | |
#<MultiFn clojure.lang.MultiFn@4706c7b2> | |
webbitchat.core=> (defmethod send-multi :SAY [msg] (println "I just called to say: " (:message msg))) | |
#<MultiFn clojure.lang.MultiFn@4706c7b2> | |
webbitchat.core=> (defmethod send-multi :YELL [msg] (println "I JUST CALLED TO YELL: " (clojure.string/upper-case (:message msg)))) | |
#<MultiFn clojure.lang.MultiFn@4706c7b2> | |
webbitchat.core=> (send-multi {:message "I love you" :action "SAY"}) |
This file contains hidden or 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
(def org1 | |
[:db/id (tmp) | |
:organization/name "Org 1" | |
:organization/league | |
[:db/id (tmp) | |
:league/name "ligue 1" | |
:league/field | |
[:db/id (tmp) | |
:field/name "The field of dreams" | |
:field/address "123 4th avenue, France"] |
This file contains hidden or 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
typedef struct HCountedArray_ { | |
size_t capacity; | |
size_t used; | |
HArena * arena; | |
struct HParsedToken_ **elements; | |
} HCountedArray; | |
typedef struct HBytes_ { | |
const uint8_t *token; | |
size_t len; |
This file contains hidden or 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
enum HParserBackend { | |
PB_MIN = 0, | |
PB_PACKRAT = PB_MIN, // PB_MIN is always the default. | |
PB_REGULAR, | |
PB_LLk, | |
PB_LALR, | |
PB_GLR, | |
PB_MAX = PB_GLR | |
} |
This file contains hidden or 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::Show; | |
trait Mappable<T> { | |
fn each<'r>(&self, f: &mut |&T|: 'r -> ()); | |
fn map<'r, B>(&self, f: &mut |&T|: 'r -> B) -> Vec<B>; | |
} | |
enum BinaryTree<T> { | |
Leaf(T), |