- GitHub Staff
- @belinburgh
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
// Map from CRUD to HTTP for our default `Backbone.sync` implementation. | |
var methodMap = { | |
'create': 'POST', | |
'update': 'PUT', | |
'delete': 'DELETE', | |
'read': 'GET' | |
}; | |
// Override this function to change the manner in which Backbone persists | |
// models to the server. You will be passed the type of request, and the |
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
Foo = {} | |
Foo.DataSource = {} | |
class Foo.DataSource.REST | |
(baseUrl) -> | |
@baseUrl = baseUrl | |
fetchAll: !-> | |
@doRequest("GET", @baseUrl, { | |
success: (data, event, response) -> | |
console.debug data |
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
application = require 'application' | |
AppView = require 'views/app_view' | |
HomeView = require 'views/home_view' | |
App = {Router: {}} | |
class App.Router.Home extends Backbone.Router | |
routes: | |
'': 'home' |
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
module = angular.module('app.controllers', []) | |
module.controller('HelloCtrl', ['$scope', ($scope) -> | |
$scope.name = "John Smith" | |
$scope.average = [1,65,2,77,34].average() | |
]) |
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
angular.module('app.controllers', []) | |
Object.keys require('./src/controllers'), (name, controller) -> | |
angular.module('app.controllers').controller(name, controller) | |
angular.module('app.directives', []) | |
Object.keys require('./src/directives'), (name, directive) -> | |
angular.module('app.directives').directive(name, directive) | |
# REFACTOR |
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 java.util.* | |
abstract class LivingThingy(val age : Int) { | |
} | |
trait Badass { | |
public fun bark() { | |
println("Wouf wouf!") | |
} | |
} |
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
Kotlin.System.flush(); | |
(function () { | |
'use strict'; | |
var _f = { | |
f0: function () { | |
Kotlin.println('Hello world!'); | |
} | |
} | |
, classes = function () { | |
var c0 = Kotlin.createClass({ |
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 t1() { | |
var ary = []; | |
for (var i = 0; i < 10000000; ++i) { | |
ary[i] = i; | |
} | |
return ary; | |
} | |
function t2() { | |
var ary = []; |
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
package controllers | |
import play.api._ | |
import play.api.mvc._ | |
object Application extends Controller { | |
def index(name: String) = Action { | |
val x = 2 + 4; | |
Ok(views.html.index("Your new application is ready." + 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
package org.mambo.core | |
import akka.actor._ | |
import akka.util.ByteString | |
import scala.collection.mutable | |
/** | |
* @author Blackrush | |
*/ | |
class LoginActor(port: Int) extends Actor with ActorLogging { |
OlderNewer