Skip to content

Instantly share code, notes, and snippets.

@sousatg
sousatg / gist:01b68236bc7b7ff31e34dc3972a881fa
Last active April 27, 2019 09:59
One liner to stop / remove all of Docker containers
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker network remove $(docker network ls -q)
@sousatg
sousatg / index.html
Created May 4, 2017 23:18
Wikipedia Viewer
<div id="wikiViewer" class="container">
<div class="row no-gutters">
<div class="col-12">
<div class="search-wrapper">
<form class="form-inline search-form">
<div class="input-group col-xs-12 col-md-6 col-lg-6">
<input type="text" class="form-control" v-model="query">
<button class="btn btn-primary" type="submit" v-on:click="search"><i class="fa fa-search" aria-hidden="true"></i></button>
<button type="button" class="btn btn-danger" v-on:click="randomPage"><i class="fa fa-random" aria-hidden="true"></i></button>
</div><!-- ./ input-group -->
@sousatg
sousatg / index.html
Created May 4, 2017 10:14
Random Quote Machine
<div class="container">
<div class="row no-gutter">
<div class="col-md-10 offset-md-1">
<div id="quote-wrapper">
<div class="row">
<div class="col">
<blockquote>
<p>{{ quote.text }}</p>
<footer>— {{quote.author}}</footer>
</blockquote>
@sousatg
sousatg / index.html
Created May 2, 2017 15:56
Vue To-Do list
<div class="container" id="app">
<div class="row justify-content-md-center">
<div class="col">
<form>
<fieldset>
<legend>Add new To-Do</legend>
<div class="form-group">
<label>Title:</label>
<input type="text" class="form-control" v-model="newTask.title">
</div>
@sousatg
sousatg / app.py
Created April 1, 2017 21:17
Tkinter multy frame
import tkinter as tk # python3
TITLE_FONT = ("Helvetica", 18, "bold")
class SampleApp(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
# the container is where we'll stack a bunch of frames
#!/usr/bin/python
# -*- coding: utf-8 -*-
class Reff:
def __init__(self, ent_id, subent_id, order_id, order_value):
self.ent_id = ent_id
self.subent_id = subent_id
self.order_id = '0000' + order_id
self.order_value = order_value
array = [3, 30, 9, 90, 27, 76, 81, 34, 49, 5, 50, 15, 53, 45, 62, 38, 89, 17, 73, 51]
@sousatg
sousatg / phantomjs-facebook-update.js
Created March 29, 2016 12:59 — forked from ariefbayu/phantomjs-facebook-update.js
facebook status update using phantomjs
var page = new WebPage();
//spoof it as opera mini, to get the mobile page working properly
page.settings.userAgent = "Opera/9.80 (J2ME/MIDP; Opera Mini/6.5.26955/27.1407; U; en) Presto/2.8.119 Version/11.10";
function doLogin(){
page.evaluate(function(){
var frm = document.getElementById("login_form");
frm.elements["email"].value = "--enter-your-email--";
@sousatg
sousatg / hilo_game.py
Created March 27, 2016 13:05
Jogo HILO em Python
import random
n = int( random.random() * 100 )
tentativas = 0
while True:
a = raw_input('Numero entre 0 e 100: ')
if int(a) == n:
@sousatg
sousatg / twitterfollowfollowers.py
Created February 14, 2016 12:19
Bot to follow followers of a twitter account
from splinter import Browser
import csv, time
class TwitterAccount:
def __init__(self, username, password):
self.username = username
self.password = password
self.b = Browser()
@sousatg
sousatg / apostilando_scrapper.py
Last active February 14, 2016 11:56
Python scrapper to download ebooks from apostilando.com.br
#!/usr/bin/env/python
# -*- coding: utf-8 -*-
import requests
import uuid
import os
import csv
from lxml import etree
import time