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
(function(mod) { | |
if (typeof exports == "object" && typeof module == "object") // CommonJS | |
return mod(require("../lib/infer"), require("../lib/tern")); | |
if (typeof define == "function" && define.amd) // AMD | |
return define(["../lib/infer", "../lib/tern"], mod); | |
mod(tern, tern); | |
})(function(infer, tern) { | |
"use strict"; | |
var WG_TEMP_OBJ = 40; |
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
<link rel="import" href="../polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
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
<link rel="import" href="../topeka-elements/theme.html"> | |
<link rel="import" href="../topeka-elements/topeka-resources.html"> | |
<link rel="import" href="../topeka-elements/topeka-app.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; |
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
* {padding:0;margin:0;} | |
img {border:0;} | |
.clear {clear:both;font-size:5px;} | |
.left {float:left;} | |
.right {float:right;} | |
.text-right {text-align:right;} | |
.center {text-align:center;} | |
.small {font-size:.857em !important;} /* 12px */ | |
.xsmall {font-size:.786em !important;} /* 11px */ |
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
LazyList<int> fibonacci([](unsigned int index, LazyList<int> *obj) -> int | |
{ | |
if(index < 2) return index; | |
return (*obj)[index-1] + (*obj)[index-2]; | |
}); | |
/* Print the first 20 fibonacci numbers */ | |
for(int i = 0; i < 20; i++) | |
printf("%d ", fibonacci[i]); |
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
#include <functional> | |
template<typename T> | |
class LazyList | |
{ | |
public: | |
typedef std::function<T(unsigned int, LazyList<T>*)> Generator; | |
LazyList(Generator gen) | |
: m_gen(gen) | |
{ |
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
func min(a1 int, a2 int, a3 int) int { | |
min := a1 | |
if a2 < min { | |
min = a2 | |
} | |
if a3 < min { | |
min = a3 | |
} | |
return min | |
} |
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
#include <utility> | |
#include <vector> | |
#include <unordered_map> | |
#include <initializer_list> | |
using namespace std; | |
template<typename T> vector<T> StaticVector(initializer_list<T> list) { return list; } | |
template<typename T, typename Y> unordered_map<T, Y> StaticHashMap(initializer_list< pair<T, Y> > list) { | |
unordered_map<T, Y> ret; | |
for (auto it = list.begin(); it != list.end(); 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
Coffeescript + types + haskell = compiled language | |
========= | |
- Increments an infinite precision number, represented as a linked list with least significant digit as head | |
increment = (x: [Num]) -> | |
switch x | |
when [] then [1] | |
when (9::tail) then 0::increment(tail) | |
when (h::t) then (h+1)::t |
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
// Top hat monocle - third party module API | |
// ===== | |
// ## Module Discovery | |
// All 3rd party modules _must_ be discoverable based on a simple http resource URI | |
// i.e. | |
// GET /modules/question | |
{ | |
name: "Question Module", |
OlderNewer