Skip to content

Instantly share code, notes, and snippets.

View isaquealves's full-sized avatar

Isaque Alves isaquealves

View GitHub Profile
@isaquealves
isaquealves / status.py
Last active July 17, 2023 20:25
Status rule
from dataclasses import dataclass
from datetime import datetime
import enum
from functools import reduce
from typing import List, Optional
import uuid
class StatusEnum(enum.Enum):
PENDING: str = "PENDING"
@isaquealves
isaquealves / README.md
Created December 16, 2021 15:24 — forked from joyrexus/README.md
The Gist to Clone All Gists

Run like so:

node gist-clone-all.js username

You'll want to replace "username" with your own username.

This script clones using the push URL, so you should probably be the owner of the gists. You could also use this to clone someone else's gists, but in that case you may wish to edit the code to use gist_pull_url instead.

@isaquealves
isaquealves / launch.json
Last active July 17, 2021 17:02
Launch.json for FastAPI app
{
//Put this file inside .vscode directory at project root directory
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: FastAPI",
"type": "python",
@isaquealves
isaquealves / hg-aliases
Created March 14, 2020 14:56
Mercurial aliases
alias hgwork="hg pull && hg update $1"
alias workon="hg update $1"
alias hgm="hgs -m"
alias hcd="hg update $1"
alias hgb="hg branch | \
tr -d '\n' | \
xclip -selection clipboard && \
echo \"$(xclip -selection clipboard -o)\" "
@isaquealves
isaquealves / Makefile
Created April 11, 2019 15:08 — forked from lumengxi/Makefile
Makefile for Python projects
.PHONY: clean-pyc clean-build docs clean
define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef
@isaquealves
isaquealves / css-media-queries-cheat-sheet.css
Created September 26, 2018 15:24 — forked from bartholomej/css-media-queries-cheat-sheet.css
CSS Media Query Cheat Sheet (with Foundation)
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
#!/bin/sh
# this works for Bash and Zsh shell
a=("it is true for all that that that that that that that refers to is not the same that that that that refers to")
# Use this with Fish shell
# set a "it is true for all that that that that that that that refers to is not the same that that that that refers to"
# or if you need to count words in a sample file,
# cat <file> | tr " " "\n" | sort -n | uniq -c
syntax: glob
.codeclimate.yml
.editorconfig
*.orig
.vscode/*
*.todo
*.tasks
.jsbeautify*
jsprofiles/*
*.orig.*
@isaquealves
isaquealves / makemodule
Last active May 4, 2017 13:35
Script to ease add python modules to applications.
#!/bin/zsh
YES='y'
OPTIND=1
MODULE_NAME=''
filename=''
dirname=''
show_help() {
echo "Use this command with caution ;) (or not)"
var Form = {
[...]
validate: function() {
var fields = this.form.querySelectorAll('input');
var self = this;
fields.forEach(function(element) {
if (self.formFields.indexOf(element.name) !== -1) {
var allowed = self.formFields[element.name].allow;
self.invalid[element.name] = matchValues(element, allowed);
}