Skip to content

Instantly share code, notes, and snippets.

View onlurking's full-sized avatar
:shipit:
ship it

Diogo Felix onlurking

:shipit:
ship it
View GitHub Profile
#!/usr/bin/env python2
from gtk.gdk import *
w = window_foreign_new((get_default_root_window().property_get("_NET_ACTIVE_WINDOW")[2][0]))
state = w.property_get("_NET_WM_STATE")[2]
maximized = '_NET_WM_STATE_MAXIMIZED_HORZ' in state and '_NET_WM_STATE_MAXIMIZED_VERT' in state
if maximized: w.unmaximize()
if w.get_decorations() == 0:
w.set_decorations(DECOR_ALL)
else:
@onlurking
onlurking / Ruby and Rails Study Roadmap.md
Created February 25, 2019 23:58
Ruby and Rails Study Roadmap
from base64 import b64encode
import pandas
from requests import get
def encode_ies_id(code):
return b64encode(bytes(str(code), 'utf-8')).decode("utf-8")
def get_ies_page(code):
url = f"http://emec.mec.gov.br/emec/consulta-ies/index/d96957f455f6405d14c6542552b0f6eb/{code}"
html = get(url).content
from xmltodict import parse
from collections import namedtuple
with open("vimwikiacom-20190108-current.xml", "rb") as file:
wiki = parse(file, xml_attribs=True)
pages = wiki['mediawiki']['page']
def extract_pages(section):
return [page for page in pages if page['title'].startswith(section)]
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
requests = "*"
[dev-packages]
pytest = "*"
@onlurking
onlurking / docker.md
Last active November 19, 2018 20:29
Docker Mastery Notes

Docker

First lecture

Verify if cli can talk to Docker engine.

docker version

View Docker engine config values.

@onlurking
onlurking / arch.md
Last active November 27, 2022 21:29
Arch Linux on Termux

Arch Linux

chroot on Termux

Let's download the Arch ARM image with curl and install proot:

apt install curl proot

Let's download the ARM Arch Linux image:

"
" ███████████████████████████
" ███████▀▀▀░░░░░░░▀▀▀███████
" ████▀░░░░░░░░░░░░░░░░░▀████
" ███│░░░░░░░░░░░░░░░░░░░│███
" ██▌│░░░░░░░░░░░░░░░░░░░│▐██
" ██░└┐░░░░░░░░░░░░░░░░░┌┘░██
" ██░░└┐░░░░░░░░░░░░░░░┌┘░░██
" ██░░┌┘▄▄▄▄▄░░░░░▄▄▄▄▄└┐░░██
" ██▌░│██████▌░░░▐██████│░▐██
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
@onlurking
onlurking / kitty.conf
Created July 27, 2018 03:55
$HOME/.config/kitty/kitty.conf
foreground #d3d0c8
background #2d2d2d
background_opacity 0.8
dynamic_background_opacity no
color0 #2d2d2d
color8 #5a5a5a
color1 #f2777a
color9 #f2777a
color2 #99cc99