Skip to content

Instantly share code, notes, and snippets.

Alan Hoffmeister alanhoff

Block or report user

Report or block alanhoff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@alanhoff
alanhoff / README.md
Last active Sep 20, 2017
Pré NodeConf
View README.md

Pré NodeConf

Não é segredo para ninguém que nos dias 4 e 5 de Julho acontecerá em São Paulo a primeira NodeConf da América Latina. Pensando nisso resolvemos criar um pré evento que consiste em uma série de eventos ao vivo e 100% gratuito no YouTube para que os participantes possam aprender um pouco mais sobre a plataforma e participar da NodeConf com uma boa base de conhecimento.

Os assuntos apresentados serão complementares aos assuntos que os palestrantes abordarão durante a NodeConf Brazil, portanto não perca tempo e adicione um

View bug.js
'use strict'
let express = require('express')
let app = express()
function test () {
return typeof null === 'undefined'
}
let reqs = 0
View mix.exs
defmodule PlugTest.Mixfile do
use Mix.Project
def project do
[app: :plug_test,
version: "0.0.1",
elixir: "~> 1.1",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps,
View gist:c14c94fc672994e18981
scopes: {
public: function() {
return {
attributes: Object.keys(attributes).filter(function(attr) {
return ['deleted', 'location'].indexOf(attr) === -1;
})
};
}
}
View query.js
{
where: {},
include: [{
model: models.Profile.scope('public'),
as: 'profile'
}]
}
@alanhoff
alanhoff / client.js
Last active Mar 4, 2020
Exemplo de SSE com Node.js
View client.js
var source = new EventSource('http://localhost:8080');
source.addEventListener('message', function(data){
console.log(data);
});
source.addEventListener('open', function(){
console.log('Conexão aberta!');
});
@alanhoff
alanhoff / express
Created Jul 24, 2015
Benchmark Hapi vs Express
View express
Server Hostname: 127.0.0.1
Server Port: 8080
Document Path: /
Document Length: 11 bytes
Concurrency Level: 100
Time taken for tests: 11.099 seconds
Complete requests: 50000
Failed requests: 0
View gist:ba78fff113d63c5c0efc
* Aplicações modernas
- Carros
- http://imguol.com/blogs/8/files/2014/06/googleselfdrive.gif
- Robótica
- http://gifsec.com/wp-content/uploads/GIF/2014/06/GIF-Robot-feeding-FAIL.gif
- Impressoras 3D
- https://a248.e.akamai.net/f/248/1/1/www.geek.com/wp-content/uploads/2014/03/5.gif
- Drones
- http://ak-hdl.buzzfed.com/static/2014-04/enhanced/webdr04/19/6/anigif_enhanced-1915-1397902864-1.gif
- IoT
View gist:a97717c0b734aa10e3c8
var insert = function(object, index, key, value) {
var rebuilded = {};
var keys = Object.keys(object);
keys.splice(index, 0, key);
keys.forEach(function(k) {
if (k === key)
rebuilded[key] = value;
else
rebuilded[k] = object[k];
@alanhoff
alanhoff / readme.md
Last active Feb 24, 2017
Cross compile Rust
View readme.md

Packages

  • Windows x86_64: sudo apt-get install gcc-mingw-w64
  • ARM sudo apt-get install arm-linux-gnueabihf-cpp-4.8
  • PowerPC sudo apt-get install gcc-powerpc-linux-gnu

Config

Create a file inside PROJECT/.cargo/config with the followig content

You can’t perform that action at this time.