Skip to content

Instantly share code, notes, and snippets.

View lauborges's full-sized avatar
💭
I may be slow to respond.

Lau Borges lauborges

💭
I may be slow to respond.
View GitHub Profile
@lauborges
lauborges / gist:c31406c7634b735918b93ab6226a45c0
Created April 4, 2020 13:56 — forked from Dufgui/gist:72debe81068bf3ecd7d8
Script to delete exited containers and untagged/unused images from docker
#!/bin/bash
set -o errexit
echo "Removing exited docker containers..."
docker ps -a -f status=exited -q | xargs -r docker rm -v
echo "Removing dangling images..."
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi
@lauborges
lauborges / .gitlab-ci.yml
Created January 23, 2019 18:54 — forked from superjose/.gitlab-ci.yml
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.
@lauborges
lauborges / index.js
Created April 2, 2017 02:12 — forked from JonathanMH/index.js
JSON Web Token Tutorial: Express
// file: index.js
var _ = require("lodash");
var express = require("express");
var bodyParser = require("body-parser");
var jwt = require('jsonwebtoken');
var passport = require("passport");
var passportJWT = require("passport-jwt");
@lauborges
lauborges / Fastfile
Created November 1, 2016 04:48 — forked from kennydee/Fastfile
Fastfile for staging environment with Appetize.io on React Native (iOs & Android), with statuses update on Github Enterprise
require 'httparty'
fastlane_version "1.95.0"
default_platform :ios
before_all do
# put here your token and iOs scheme app
ENV["GITHUB_TOKEN"] = "---"
ENV["APPETIZE_TOKEN"] = "---"
ENV["APP_IOS_SCHEME"] = "---"
@lauborges
lauborges / gist:0dfdfdce255cc916b800
Last active August 29, 2015 14:26 — forked from moraes/gist:2141121
LIFO Stack and FIFO Queue in golang
package main
import (
"fmt"
)
type Node struct {
Value int
}
@lauborges
lauborges / dump.sql
Created February 21, 2013 19:57 — forked from manfe/dump.sql
-- Os dados contidos nesse arquivo foram extraídos do site: http://ibge.gov.br/cidadesat utilizando ruby, nokogiri e expressões regulares.
-- Autor: Mauricio Natanael Ferreira
-- Github: https://github.com/manfe
-- Twitter: @manfe01
-- Email: contato [at] ferreiramauricio [dot] com
-- ***********************************************************************************************************************************************
-- id ...
/*
* Copyright 2013, Cassiano Rabelo (http://www.cassianorabelo.com)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @Copyright Copyright 2013, Cassiano Rabelo (http://www.cassianorabelo.com)
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
* Date: 01/03/2013
* Fonte: http://www.ibge.gov.br/cidadesat
class PopulaEstadosCidades < ActiveRecord::Migration
def self.up
Estado.create(:sigla => 'AC', :nome => "Acre") do |e|
e.cidades.build(:nome => "Acrelândia")
e.cidades.build(:nome => "Assis Brasil")
e.cidades.build(:nome => "Brasiléia")
e.cidades.build(:nome => "Bujari")
e.cidades.build(:nome => "Capixaba")
e.cidades.build(:nome => "Cruzeiro do Sul")
e.cidades.build(:nome => "Epitaciolândia")
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@lauborges
lauborges / github_repos.rb
Created July 24, 2011 23:50 — forked from akitaonrails/github_repos.rb
manage all github repositories (yours and watched) with a single command.
#!/usr/bin/env ruby
#
# Brute-force way to retrieve all Github's repositories at once
# Usage:
# github_repos.rb clone # will clone all the user's repositories
# github_repos.rb clone test # will just clone 6 repositories for testing purposes
# github_repos.rb pull # will update all of the user's local repositories
#
# If you have forked repositories, the original sources will be added
# as remotes with the default 'forked_from' name, and a new 'forked_from'