- jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
- Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
- AngularJS - Conventions based MVC framework for HTML5 apps.
- Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
- lawnchair - Key/value store adapter for indexdb, localStorage
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
fn main() {} | |
#[no_mangle] | |
pub fn add_one(x: i32) -> i32 { | |
x + 1 | |
} |
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
fn main() {} | |
#[no_mangle] | |
pub fn add_one(x: i32) -> i32 { | |
x + 1 | |
} |
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
declare module Foo { | |
export class Hoge { | |
f(str:string, n: number, obj: Object): number; | |
s: string; | |
//f(name:string): number; | |
} | |
} |
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
declare module Foo { | |
export class Hoge { | |
name:string; | |
message:string; | |
constructor(); | |
f(str:string):string; | |
} | |
} |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
import scala.reflect.{classTag, ClassTag} | |
object Injector { | |
private val rootInjector = new Injector(None) | |
def createInjector = rootInjector.createChild(rootInjector) | |
def mapValue[T:ClassTag](instance:T): Unit = | |
rootInjector.mapValue[T](instance) | |
} | |
class Injector(val parent:Option[Injector]) { |
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
# in gruntfile.coffee | |
{exec} = require('child_process') | |
runCommand = (exp, done) -> | |
exec exp, (error, stdout, stderr) -> | |
return done(true) if error or stderr | |
done(false,stdout) | |
grunt.registerMultiTask 'test', 'test command', -> | |
conf = @ |
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
sinon = require 'sinon' | |
# class stubbing | |
class MockClass | |
method: -> | |
method2: -> | |
sinon.stub(MockClass.prototype, 'method').withArgs(1).returns 42 | |
obj = new MockClass | |
console.log obj.method(1) #=> 42 |