Skip to content

Instantly share code, notes, and snippets.

// 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
Foo = {}
Foo.DataSource = {}
class Foo.DataSource.REST
(baseUrl) ->
@baseUrl = baseUrl
fetchAll: !->
@doRequest("GET", @baseUrl, {
success: (data, event, response) ->
console.debug data
application = require 'application'
AppView = require 'views/app_view'
HomeView = require 'views/home_view'
App = {Router: {}}
class App.Router.Home extends Backbone.Router
routes:
'': 'home'
module = angular.module('app.controllers', [])
module.controller('HelloCtrl', ['$scope', ($scope) ->
$scope.name = "John Smith"
$scope.average = [1,65,2,77,34].average()
])
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
import java.util.*
abstract class LivingThingy(val age : Int) {
}
trait Badass {
public fun bark() {
println("Wouf wouf!")
}
}
Kotlin.System.flush();
(function () {
'use strict';
var _f = {
f0: function () {
Kotlin.println('Hello world!');
}
}
, classes = function () {
var c0 = Kotlin.createClass({
@hmaurer
hmaurer / t078.js
Created December 9, 2012 00:55 — forked from Constellation/t078.js
function t1() {
var ary = [];
for (var i = 0; i < 10000000; ++i) {
ary[i] = i;
}
return ary;
}
function t2() {
var ary = [];
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))
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 {