Skip to content

Instantly share code, notes, and snippets.

View mageddo's full-sized avatar
💭
🚲 🍺

Elvis Souza mageddo

💭
🚲 🍺
View GitHub Profile
@mageddo
mageddo / logger.js
Created November 8, 2015 15:24 — forked from rtgibbons/logger.js
Logger Library with winston
var app = require(process.cwd() + '/app');
var winston = require('winston');
var _ = require('lodash');
// Set up logger
var customColors = {
trace: 'white',
debug: 'green',
info: 'green',
warn: 'yellow',
@mageddo
mageddo / sqlite3mysql.py
Created November 28, 2015 20:00 — forked from techouse/sqlite3mysql.py
A simple Python 3 script to transfer the data from SQLite 3 to MySQL. Requires MySQL Connector/Python 2.0.4 or higher.
#!/usr/bin/env python3
__author__ = "Klemen Tušar"
__email__ = "techouse@gmail.com"
__copyright__ = "GPL"
__version__ = "1.0.1"
__date__ = "2015-09-12"
__status__ = "Production"
import os.path, sqlite3, mysql.connector
@mageddo
mageddo / 0_reuse_code.js
Created February 22, 2016 19:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mageddo
mageddo / using-functions.js
Last active March 7, 2016 18:44
Javascript "Lambdas"
// with functions
var Person = function() {
this.say = message => console.log('you said: ', message);
this.getOnHand = (hand1, hand2) => {
console.log(hand1, 'at left hand');
console.log(hand2, 'at right hand');
}
};
var p1 = new Person();
@mageddo
mageddo / script.md
Last active March 15, 2016 17:08
Delete all docker images and containers

Deleting images

docker rmi $(docker images | awk '{print $3}')
# when you delete the images the containers are deleted too
@mageddo
mageddo / app.js
Created March 16, 2016 16:33
Notificador de status da entrega correios
(function($){
var codigo = 'PI861904134BR';
var ultimoRastreio;
permissionsNotificar();
acompanharRastreio();
function acompanharRastreio(){
window.intervalo = setInterval(() => {
rastrear(codigo, (err, data) => {
if(err){
return console.error(err);
@mageddo
mageddo / README.md
Last active March 17, 2016 14:09
Run Lubuntu GUI On docker

Using it

  • Run docker image with start.sh script
  • Set your password for vnc access
  • Access 127.0.0.1:5901 on your vnc client
  • Set your password

Enjoy

@mageddo
mageddo / Dockerfile
Created March 17, 2016 14:01
Running Ubuntu GUI on Docker
# Firefox over VNC
#
# VERSION 0.1
# DOCKER-VERSION 0.2
from ubuntu:12.04
# make sure the package repository is up to date
run echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
run apt-get update
@mageddo
mageddo / README.md
Created March 17, 2016 16:46
Linux Service Example

Using it

cp ./whatever /etc/init.d/
sudo service whatever start
sudo service whatever stop
@mageddo
mageddo / console
Created March 17, 2016 16:47 — forked from dmitriy-kiriyenko/console
Init.d to start/stop xvfb. Put it into /etc/init.d and chmod it to 755
apt-get install xvfb
apt-get install firefox