Skip to content

Instantly share code, notes, and snippets.


Leo Vidarte lvidarte

View GitHub Profile
lvidarte / gist:1aeb2b58d874d19eed5e6fea6f0e7ed2
Created Mar 27, 2019
Build image inside minikube and then use it from there
View gist:1aeb2b58d874d19eed5e6fea6f0e7ed2
# Start minikube
minikube start
# Set docker env
eval $(minikube docker-env)
# Build image
docker build -t foo:0.0.1 .
# Run in minikube
lvidarte / test.ipynb
Created Jul 28, 2018
Test Jupyter Notecook
View test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View tirar
from selenium import webdriver
browser = webdriver.Chrome()
e = browser.get_element_by<tab>
e = browser.find_element_by_css_selector("div.banner-content > div.content > div:nth-child(3)")
lvidarte /
Created Nov 19, 2017 — forked from Kartones/
PostgreSQL command line cheatsheet


Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
lvidarte /
Last active Nov 6, 2017 — forked from marianposaceanu/
How to have some fun using the terminal.

Linux fun-o-matic

How to have some fun using the terminal.

  1. Install cowsay [0] via : sudo apt-get install cowsay
  2. Install fortune [1] via : sudo apt-get install fortune
  3. Make sure you have Ruby installed via : ruby -v
  4. Install the lolcat [2] via : gem gem install lolcat
  5. Profit!
View shellinabox-proxy.go
package main
import (
View gist:14864e94c857fb3bc0eca805d977ec8d
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
lvidarte / promises.js
Created Jun 27, 2017
Node 8 - Promises recursion
View promises.js
var myPromise = (i) => {
let time = Math.floor(Math.random() * 5000) + 5000;
console.log(`new promise ${i} for ${time}ms`)
return new Promise((resolve, reject) => {
let random = Math.floor(Math.random() * 2);
lvidarte / express.js
Created Jun 27, 2017
Node 8 - Cluster Express server
View express.js
var cluster = require('cluster');
const PORT = 3000;
if (cluster.isMaster) {
const numWorkers = require('os').cpus().length;
console.log(`Master cluster setting up ${numWorkers} workers...`);
from flask import Flask, request, jsonify
app = Flask(__name__)
data = {}
@app.route("/<name>", methods=['GET', 'POST'])
def endpoint(name):
if request.method == 'POST':
if name not in data:
data[name] = []