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 | |
//define simple route | |
$app->get('/', function ($req, $res, $next) { | |
$res->render('main.tpl', array('title'=>'Hello world')); | |
}); | |
//mount class | |
$app->mount('MyController', '/myctrl'); |
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 a = function (v) { | |
function b (v) { | |
return 42; | |
} | |
return b(v); | |
} | |
var start = (new Date).getTime(); | |
for (var i=0; i < 1e6; 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
mark@in137:~$ cd tmp | |
mark@in137:~/tmp$ mkdir express-test | |
mark@in137:~/tmp$ cd express-test | |
mark@in137:~/tmp/express-test$ express | |
create : . | |
create : ./package.json | |
create : ./app.js | |
create : ./public | |
create : ./routes |
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
mrak@nixbox:~/GIT/visionmedia/superagent$ make test | |
................................................................ | |
✖ 18 of 64 tests failed: | |
1) request with an object should format the url: | |
TypeError: object is not a function | |
at Object.CALL_NON_FUNCTION (native) | |
at Request.callback (/home/mrak/GIT/visionmedia/superagent/test/node/basic.js:46:9) |
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
#!/bin/sh | |
FILES=`git status --porcelain | grep -P '^[\sAM]+' | sed 's/\(^\s*[AM]\+\)\s\+//'` | |
G="grep -n -H --color=auto -P" | |
RED=`echo -e '\033[41m\033[37m'` | |
NORMAL=`echo -e '\033[0m'` | |
for file in `echo $FILES | sort -u` | |
do | |
$G console $file | |
$G var_dump $file |
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 about() { | |
/* | |
Subject: Сайт-призрак | |
Date: 2012-06-01 | |
Этот сайт сделан для прикола. | |
*/ | |
} |
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 automata = require('automata') | |
, yql = require('yql') | |
, readline = require('readline') | |
; | |
automata.registerFSM({ | |
name : "Test", | |
logic : TestLogic, | |
state : [ | |
{ name : 'idle', onEnter : 'idle', initial : true }, |
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
public function getDistanceTo(Geometry_Point $anotherPoint) | |
{ | |
//TODO!!!! | |
if($this->getProjection() !== $anotherPoint->getProjection()) | |
{ | |
throw new Geometry_Exception('Projection mismatch'); | |
} | |
$lat1 = $this->getLat(); |
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 | |
// Construct an HTTP POST request | |
$clientlogin_url = "https://www.google.com/accounts/ClientLogin"; | |
$clientlogin_post = array( | |
"accountType" => "HOSTED_OR_GOOGLE", | |
"Email" => "*********************************************", | |
"Passwd" => "*********************************************", | |
"service" => "writely", | |
"source" => "my-fake-app" |
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 | |
class GReader { | |
protected $auth; | |
public function __construct($login, $password) { | |
$clientlogin_url = "https://www.google.com/accounts/ClientLogin"; | |
$clientlogin_post = array( | |
"accountType" => "HOSTED_OR_GOOGLE", |
OlderNewer