Skip to content

Instantly share code, notes, and snippets.

View joseph-montanez's full-sized avatar

Joseph Montanez joseph-montanez

View GitHub Profile
@joseph-montanez
joseph-montanez / README.md
Created March 13, 2012 15:44
Benchmark between NodeJS, PHP, Python, Ringojs and Railo - Object Creation

These benchmarks were done on Windows 7 64 bit, AMD Phenom II X3 720 Process 2.80 GHz, 4 GB RAM

10,000 Objects Created

  • NodeJs 0.6.13 Finished in: 30ms

  • PHP 5.4 Finished in: 37ms

  • Python 3.2.2 Finished in: 70ms

@joseph-montanez
joseph-montanez / README.md
Created March 19, 2012 00:20
Components Test

Component Based Finished in: 935ms

Functional Based Finished in: 26ms

@joseph-montanez
joseph-montanez / main.vala
Created July 25, 2012 07:56
Parse a date in Vala
void main () {
print ("Please enter in a date to be parsed: ");
var readDate = stdin.read_line ();
if (readDate != null) {
var parsedDate = Date ();
parsedDate.set_parse (readDate);
if (parsedDate.valid ()) {
var output = new char[100];
var format = "%c";
var success = parsedDate.strftime (output, format);
@joseph-montanez
joseph-montanez / item-listing.js
Created August 15, 2012 19:44
Php to Javascript Transcoder
<script type="text/javascript">
var js_templates = js_templates || {};
js_templates['item-listing'] = function (data) {
var result_string = [];
result_string.push('<ul>');
var key_502cbbed82967;
for (key_502cbbed82967 in data.items) {
var item = data.items[key_502cbbed82967];
result_string.push('<li class="item');
result_string.push((data.item['sale']) ? ' sale' : '');
pragma License (Gpl);
pragma Ada_2012;
with Ada.Text_IO;
procedure App is
package I_IO is new Ada.Text_IO.Integer_IO (Integer);
function Add (X : in Integer; Y : in Integer) return Integer
with
function<Fl_Event_Handler> fn;
fn = [data] (int event) -> int {
return on_event(event, data);
};
Fl::add_handler(fn);
// error: aggregate ‘std::function<int (*)(int)> fn’ has incomplete type and cannot be defined
// Fl_Event_Handle siganture is "int (*)(int)"
@joseph-montanez
joseph-montanez / composer.json
Last active December 19, 2015 22:58
async mysqli vs sync mysqli
{
"name": "shabb/mysql",
"description": "async mysql",
"require": {
"react/react": "0.3.*"
},
"license": "BSD",
"authors": [
{
"name": "Joseph Montanez",
@joseph-montanez
joseph-montanez / error.txt
Last active December 20, 2015 16:59
main cannot determine the type of gameloop?
recur.hs:15:1: Couldn't match expected type `IO t0' with actual type `World' In the expression: main When checking the type of the function `main'
data GameState = Running | Paused | Stopped
data World = World {
gameState :: GameState,
loopCount :: Int
}
gameloop world =
case gameState world of
Running -> do
@joseph-montanez
joseph-montanez / error.txt
Created August 6, 2013 23:57
get a parameter regardless of record type?
food.fs(25,25): error FS0001: This expression was expected to have type
fruit
but here has type
vegie