Skip to content

Instantly share code, notes, and snippets.

View Ronkiro's full-sized avatar
😃
The real answer is 42.

Alexander Santos Ronkiro

😃
The real answer is 42.
View GitHub Profile
@Ronkiro
Ronkiro / gist:eccc6a6b3f61e694ddc08e77fd75b3e9
Last active March 10, 2021 14:04
Detect scroll overflow
var docWidth = document.documentElement.offsetWidth;
[].forEach.call(
document.querySelectorAll('*'),
function(el) {
if (el.offsetWidth > docWidth) {
console.log(el);
}
}
import ctypes
kernel32 = ctypes.WinDLL('kernel32')
user32 = ctypes.WinDLL('user32')
SW_HIDE = 0
hWnd = kernel32.GetConsoleWindow()
if hWnd:
user32.ShowWindow(hWnd, SW_HIDE)
let pwRegex = /(?=\w{5,})(?=\D*\d{2}\D*)/;
@Ronkiro
Ronkiro / initializer.py
Created February 20, 2019 17:01
Initializer Pattern - Python
class APIService():
""" Manipula uma API """
def __init__(self,
is_live=False,
API=None):
""" Inicia serviços de API.
:param API: Constrói uma API child.
"""
@Ronkiro
Ronkiro / splashscreen_demo_1.py
Created February 8, 2019 14:24 — forked from 345161974/splashscreen_demo_1.py
PyQt SplashScreen Demo
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import time
class Form(QDialog):
""" Just a simple dialog with a couple of widgets
"""
def __init__(self, parent=None):
super(Form, self).__init__(parent)
@Ronkiro
Ronkiro / python.json
Created February 4, 2019 17:24
VSCode Py Snippets
{
// Place your snippets for python here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",