Skip to content

Instantly share code, notes, and snippets.

View Fawers's full-sized avatar
💻
Studying and gaming

Fabricio Werneck Fawers

💻
Studying and gaming
View GitHub Profile
@Fawers
Fawers / commit-msg
Last active September 21, 2025 22:36
include jira ticket in commit message
#!/usr/bin/python
import re
import subprocess
import sys
jira_pattern = re.compile(r"[A-Z0-9]+-\d+")
commit_msg_filename = sys.argv[1]
with open(commit_msg_filename) as f:
commit_msg = f.read()
@Fawers
Fawers / attempt0.scala
Last active July 22, 2022 21:28
timers and schedulers
import java.util.Date
import akka.actor._
import scala.concurrent.duration._
class TimedActor extends Actor with ActorLogging {
override def receive: Receive = onTimer(None, None)
def onTimer(msgReceived: Option[Date], oldTimer: Option[Cancellable]): Receive = {
case msg =>
oldTimer foreach (_.cancel())
@Fawers
Fawers / untar_into.sh
Created December 13, 2021 18:21
Untar ARCHIVE into DIR
function untar_into() {
[[ -z "$1" ]] && echo "No tar file specified" && return
[[ -z "$2" ]] && echo "No destination specified" && return
[[ ! -e "$1" ]] && echo "Specified tar file absent: $1" && return
[[ -e "$2" ]] && echo "Destination dir already exists: $2" && return
local archive=$1
local target=$2
mkdir -pv $target
mv $archive $target
@Fawers
Fawers / world-of-trouble.md
Last active June 8, 2019 21:35
Vian Izak - World of Trouble

Vian Izak - World of Trouble

Capo 7 (may be different to you; I use a customized tuning)

Intro
G C Em D
G C Em D

I'm not afraGid that we falCtered before
Every faEmll we endured made us wantD it all more

@Fawers
Fawers / keybindings.json
Last active April 24, 2019 12:26
VSCode Settings + Keybindings
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "alt+j",
"command": "editor.action.triggerSuggest",
"when": "editorHasCompletionItemProvider && editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+space",
"command": "-editor.action.triggerSuggest",
@Fawers
Fawers / main.go
Created April 11, 2019 23:04
async - go and python
// https://repl.it/@fswerneck/goroutines
package main
import "fmt"
func consume(q <-chan interface{}, finish chan<- bool) {
fmt.Println("getting from q")
mydata := <-q
fmt.Printf("got %v from q\n", mydata)

Advérbios vs. Adjetivos

Regra de linguística geral:

  • Advérbios modificam tudo, até mesmo outros advérbios, com exceção de substantivos
  • Apenas adjetivos modificam substantivos, e modificam apenas substantivos

Isso se aplica em qualquer idioma.

A maioria dos advérbios são, por si só, criados a partir de adjetivos.

@Fawers
Fawers / wkreorder.js
Last active June 6, 2018 02:57
WaniKani Reorder
/**
* 2018-04-25
* WaniKani Reorder - wkreorder
* Reorder your review items on the fly
* (Optimized for phones)
*
* With wk-reorder, you're able to - tada - reorder your review items by some criteria.
* As of this script, you're able to reorder them by SRS level, and type.
* The script works by getting your current queue, and applying a sort function to make it
* show items in the order you want them to - either ascendingly or descendingly.
@Fawers
Fawers / wkrollback.js
Last active April 1, 2018 23:39
WaniKani Rollback Answer
/**
* wkrollback - WaniKani Rollback Answer
* Inspired by Wanikani Override userscript on Greasy Fork,
* but aimed at mobiles, as an inline JavaScript bookmarklet.
* This is the unminified code; use the minified version on
* your browser.
*
* Author: Fabricio da Silva Werneck
* Date: 2018-04-01 19:24 -0300
*
@Fawers
Fawers / verbs.md
Last active December 25, 2017 05:22
Japanese verbs and their patterns

PSA: Verb conjugation becomes fairly easy when you get to understand the pattern.

Disclaimer: I may or may not have made some mistakes below. Do feel free to point them out so I can edit the post.


(irregular verbs not included)

  • Ichidan verbs
  • Always end in る