Skip to content

Instantly share code, notes, and snippets.

View francisbrito's full-sized avatar
💭
💻 🌴 🇩🇴

Francis Brito francisbrito

💭
💻 🌴 🇩🇴
View GitHub Profile
@francisbrito
francisbrito / .vimrc
Last active December 24, 2015 03:59
JavaScript development setup.
" VIM configuration.
"" General
set nocompatible
set laststatus=2
filetype off
set number " Show line numbers
set linebreak " Break lines at word (requires Wrap lines)
set showbreak=+++ " Wrap-broken line prefix
@francisbrito
francisbrito / perf-test-async.js
Created May 1, 2013 12:35
A simple performance tests written in JavaScript using Node.js + Async module. Note: Assumes 'async' module is installed.
var fs = require('fs');
var async = require('async');
var count = 0;
var startTime = Date.now();
fs.readFile('seeds.txt', { encoding: 'utf-8' }, function(err, text){
var lines = text.split('\n');
var fnArray = [];
@francisbrito
francisbrito / PerfTestTplPlinq.cs
Created May 1, 2013 11:28
A simple performance test written in C# using TPL. (PLINQ)
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace PerfTestTpl.ParallelImpl
{
internal class Program
{
@francisbrito
francisbrito / PerfTestTplForEach.cs
Created May 1, 2013 11:26
A simple performance test written in C# using TPL. (Parallel.ForEach)
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace PerfTestTpl.ParallelImpl
{
internal class Program
{
@francisbrito
francisbrito / PerfTestTplFor.cs
Last active December 16, 2015 20:48
A simple performance test written in C# using TPL. (Parallel.For)
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace PerfTestTpl.ParallelImpl
{
class Program
{
@francisbrito
francisbrito / PerfTestTpl.cs
Created May 1, 2013 03:23
A simple performance test in C# using .NET 4.5 + TPL. Notes: Assumes "Nito.AsyncEx" package is installed.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Nito.AsyncEx;
namespace PerfTestTpl
{
// DOM (JavaScript)
// Ganchos: Para que funcione debe de ser ejecutado desde http://emplea.do
// ******** Esto se debe a restrinciones de seguridad en los navegadores.
var request = new XMLHttpRequest();
var url = 'http://www.emplea.do/jobs.json';
request.open('GET', url);
request.onreadystatechange = function(){
if(request.readyState == request.DONE){
@francisbrito
francisbrito / gist:4521656
Created January 13, 2013 01:27
HTML: Mobile Hybrid App Template
<!doctype html>
<html lang="en">
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, width=device-width, user-scalable=no">
</head>
<body>
<section class="app">
</section>