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
<?php | |
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
function node_load($param) { | |
echo $param; | |
} |
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
require 'celluloid/io' | |
require 'faraday' | |
require 'benchmark' | |
class HttpClient | |
include Celluloid::IO | |
attr_accessor :conn |
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
[:program, | |
[[:class, | |
[:const_ref, [:@const, "Context", [4, 8]]], | |
nil, | |
[:bodystmt, | |
[[:def, | |
[:@ident, "pippo", [6, 8]], | |
[:params, nil, nil, nil, nil, nil], | |
[:bodystmt, | |
[[:string_literal, |
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
var directives; | |
directives = angular.module("myApp.directives", ['ngResource']); | |
(function(){ | |
this.directive("jsonresource", function($resource){ | |
return function(scope, element, attrs){ | |
console.log(attrs.variable); | |
return scope[attrs.variable] = $resource(attrs.path).get(); | |
}; | |
}); | |
}.call(directives)); |
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
#hacking Kernel module for add loop_every | |
module Kernel | |
def loop_every(n,&blk) | |
blk.call | |
n=n*1000 | |
`setInterval(function() {` | |
blk.call | |
`},n);` | |
end | |
end |
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 Jquery | |
module WrapMethods | |
def WrapMethods.included(base) | |
# i can't use extend on opal. why? | |
class << base | |
def wrap_method(meth) |
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
<? | |
return array("a" => $title); |
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
class Main { | |
public static function getInjector() { | |
var inject=new Injector(); | |
inject.service("logger",function(context) { | |
trace(context); | |
return 9999; | |
}); |
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
chained_method= (obj,method,fn) -> obj::[method]= ()-> fn.apply(@,arguments);@ | |
class Base | |
constructor: -> @n=0 | |
chained_method @,'sum', (x) -> @n=@n+x | |
chained_method @,'minus', (x) -> @n=@n-x | |
chained_method @,'pp', (x) -> console.log @n | |
(new Base).sum(3).minus(10).pp() |
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
-- Code thaked from http://en.literateprograms.org/Fibonacci_numbers_(Lua)? | |
-- for benchmarking lua and luajit | |
-- at bottom of files the result of benchmark | |
-- Copyright (c) 2011 the authors listed at the following URL, and/or | |
-- the authors of referenced articles or incorporated external code: | |
-- http://en.literateprograms.org/Fibonacci_numbers_(Lua)?action=history&offset=20081019232035 | |
-- | |
-- Permission is hereby granted, free of charge, to any person obtaining |