Skip to content

Instantly share code, notes, and snippets.

View rafaeljesus's full-sized avatar

Rafael Jesus rafaeljesus

  • Berlin, Germany
View GitHub Profile
'use strict'
/**/
function moda (arr) {
return ((arr.sort((a, b) =>
(arr.filter(v => v === a).length) - (arr.filter(v => v === b).length))
).pop())
}
module.exports = moda
console.log(moda([1,2,3,4,5])) //amodal nao tem moda(nao deveria aparecer nada)
@brunoksato
brunoksato / json.go
Created June 10, 2016 11:52
helpers json
func ModelToJson(model interface{}) string {
j, err := json.Marshal(model)
if err != nil {
panic(fmt.Sprintf("Error %v encoding JSON for %v", err, model))
}
jsonStr := string(j)
v := reflect.Indirect(reflect.ValueOf(model))
ot := v.Type()
t := ot
const log = function(args) {
args = Array.isArray(args) ? args : Array.prototype.slice.call(arguments)
console.log.apply(console, args);
};
const tOut = function(time) {
return new Promise(function(resolve) {
setTimeout(() => {
resolve(time);
}, time);

Pismo - Desenvolvedor Backend

Descrição da Vaga

Trabalhamos bastante com serviços da AWS como: Beanstalk, DynamoDB, SQS, KMS, ElastiCache e RDS, além de estarmos sempre melhorando nosso processo com ferramentas como Jenkins, Nexus, Sonar, Jira e Github, então seria legal que você tivesse experiência com as ferramentas ou similares.

Nosso trabalho

Oferecemos um ótimo ambiente para aprendizado, tanto com cursos online quanto com compartilhamento de conhecimento dentro da equipe. Gostamos de tecnologia, gostamos de melhorar o que já temos e de realizar entregas cada vez com mais qualidade. Gostamos de tech-talks e tentamos realizar com frequência (atualmente até 1x semana, porém AINDA só internamente)

Local

From zero to microservice with 𝚫 now

The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.

It uses Open Source tools that are widely available, tested and understood:

  • Node.JS
  • NPM
  • Express
@ArturT
ArturT / README.md
Last active October 24, 2016 18:59 — forked from joakimk/README.md
CircleCI elixir build example

This runs a build for a small elixir (phoenix) project in about 40 seconds by caching as much of the compiled files as possible.

We've been using this for months in multiple projects without any issues. Please ping be if there is any issues with this script and I'll update it.

It should be generic enough to work on any elixir app using mix.

If you have a elixir_buildpack.config, then enable that section in the build script to keep versions in sync!

Extra note

@AntoineAugusti
AntoineAugusti / limitConcurrentGoroutines.go
Last active July 30, 2024 17:58
Limit the maximum number of goroutines running at the same time
package main
import (
"flag"
"fmt"
"time"
)
// Fake a long and difficult work.
func DoWork() {
@iamralch
iamralch / context.go
Created November 20, 2015 13:05
An example that illustrates how to work with https://godoc.org/golang.org/x/net/context
package main
import (
"bufio"
"fmt"
"os"
"strings"
"time"
"golang.org/x/net/context"
@stephantabor
stephantabor / bb.js
Last active January 6, 2024 04:18
Bluebird .each vs .mapSeries vs .map
var Promise = require('bluebird');
var funcs = Promise.resolve([500, 100, 400, 200].map((n) => makeWait(n)));
funcs
.each(iterator) // logs: 500, 100, 400, 200
.then(console.log) // logs: [ [Function], [Function], [Function], [Function] ]
funcs
.mapSeries(iterator) // logs: 500, 100, 400, 200
@DenisIzmaylov
DenisIzmaylov / INSTALLATION.md
Last active November 9, 2024 13:39
DigitalOcean Dokku: fresh install with Node.js Environment

DigitalOcean Dokku / Node.js Cloud Environment

Custom recipe to get full Node.js Cloud Environment in DigitalOcean Dokku droplet running from scratch. Yes. Your own Heroku for $5 per month.

I use this gist to keep track of the important configuration steps required to have a functioning system after fresh install.

When you have executed that's all step by step you will get a new working and stable system which is ready to host & serve your Node.js application and databases.