Skip to content

Instantly share code, notes, and snippets.

View pedrofaria's full-sized avatar
🇧🇷
Eu sou o Pedro

Pedro Faria pedrofaria

🇧🇷
Eu sou o Pedro
View GitHub Profile
eu ~/src/clever/benchmark $ sh run.sh
Running threads benchmark...
threads/threads_001.clv:
Time elapsed single-thread version clever: 2.31208
Time elapsed multi-thread version clever: 1.55628
Relative time difference: 32.6888 %
Result: 200000010000000
[OK]
threads/threads_001.py: [python version]
Time elapsed single-thread python: 3.37006902695
eu ~/src/clever/benchmark $ sh run.sh
Running threads benchmark...
threads/threads_001.clv:
Time elapsed single-thread version clever: 2.30588
Time elapsed multi-thread version clever: 1.54125
Relative time difference: 33.1601 %
Result: 200000010000000
[OK]
threads/threads_001.py: [python version]
Time elapsed single-thread python: 3.55690193176
eu ~/src/clever/benchmark $ sh run.sh
Running threads benchmark...
threads/threads_001.py: [python version]
Time elapsed single-thread python: 3.37238383293
Time elapsed multi-thread python: 2.16011404991
Relative time difference: 35.9469693569 %
Result: 200000010000000
[OK]
threads/threads_001.lua: [lua version]
[OK]
function shorten_url(url,callback) {
var XHR = Titanium.Network.createHTTPClient({
onload: function () {
try {
shorturl = JSON.parse(this.responseText);
shorturl = shorturl.id;
} catch(e) {
shorturl = false;
}
@pedrofaria
pedrofaria / sqlx.js
Created October 6, 2012 22:08
New adapter for alloy models
/*
* Local SQLite sync adapter which will store all models in
* an on device database
*/
var _ = require('alloy/underscore')._,
db;
function S4() {
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
};
pedro@FIOPREV2256-linux:~/src/clever$ cmake .
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 26 Mar 2012 19:00:43 GMT
Content-Type: video/mp4
Connection: keep-alive
X-Mod-H264-Streaming: version=2.2.7
Content-Length: 42052720
Last-Modified: Wed, 09 Jun 2010 03:46:06 GMT
Accept-Ranges: bytes
X-Edge-Id: 688143469
#!/Users/eu/src/clever/clever
import std;
import 'cleverfw.clv' as fw;
Map<String, Function<Int>> routesGet;
routesGet.insert("^sign_up$", Int () {
println("PLEASE, SIGN UP NOW!");
return 1;
import std;
extern "libcurl" {
FFIObject curl_easy_init();
Int curl_easy_setopt(FFIObject handle, Int option, String param);
Int curl_easy_perform(FFIObject handle);
Void curl_easy_cleanup(FFIObject handle);
}
FFIObject c, r;
import std;
extern libcurl {
FFIObject curl_easy_init();
}
FFIObject c;
curl_easy_init();