Skip to content

Instantly share code, notes, and snippets.

View crgimenes's full-sized avatar
🏠
Working from home

Cesar Gimenes crgimenes

🏠
Working from home
View GitHub Profile
@jniltinho
jniltinho / update-golang.sh
Last active December 23, 2023 00:33
Update Golang *Nix
#!/bin/bash
## Update Golang (Linux/Mac)
/usr/local/go/bin/go version
LOCAL_VERSION=$(/usr/local/go/bin/go version|awk '{print $3}')
## Get Last Stable Version
LAST_VERSION=$(curl -s 'https://go.dev/VERSION?m=text'|head -n1)
OS="linux"
ARCH="amd64"
@felipemanga
felipemanga / fullauto.cpp
Last active February 2, 2024 03:36
Improved devterm automatic gearbox
// Compile like this: g++ fullauto.cpp --std=c++17 -o fullauto
// Run like this: sudo fullauto &
#include <thread>
#include <chrono>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
@protosam
protosam / basic-sshd.go
Last active May 18, 2024 20:59
Simple ssh server example in go.
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@phortuin
phortuin / signing-git-commits.md
Last active July 15, 2024 08:53
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg
@saragiotto
saragiotto / customCK62MacOSx.json
Last active February 7, 2021 13:53
If you facing some troubles using your brand new MotoSpeed CK62 on a Mac OS X, you can use Karabiner app together with this custom key bindings to make your life easier!
{
"title": "Motospeed CK62 layer fix",
"maintainers": ["Leonardo Saragiotto"],
"homepage": "https://gist.github.com/saragiotto/48d173d9bf4895e0d25389d5a5d7b75e",
"import_url": "karabiner://karabiner/assets/complex_modifications/import?url=https://gist.githubusercontent.com/saragiotto/48d173d9bf4895e0d25389d5a5d7b75e/raw/1a46faaaf0c4f66079e4efecc14a9ef793fc4dff/customCK62MacOSx.json",
"rules": [
{
"description": "Fix ? key, forward delete and alt tab for windows and tilde accent",
"manipulators": [
{
@whoisryosuke
whoisryosuke / Update-branch.md
Created September 17, 2019 17:38 — forked from santisbon/Update-branch.md
Bring your feature branch up to date with master. Deploying from Git branches adds flexibility. Bring your branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master

@nicolas-sabbatini
nicolas-sabbatini / 10_PRINT.lua
Created July 15, 2019 01:09
The famous one line program 10 PRINT in lua
::_10:: io.write(math.random() < 0.5 and "/" or "\\"); goto _10
@trumae
trumae / main.go
Last active June 6, 2019 23:20
Golang - ponteiros que trocam de valor
package main
func main() {
var x [10]int
var y = &x[2] //ref to array contetn
var z = y // ref copy
println(&x, y, z)
a(x)
println(&x, y, z)
from datetime import datetime
github_date = datetime.strptime(input_data['github_date_str'], '%Y-%m-%dT%H:%M:%SZ')
weeknumber = int(github_date.strftime("%w"))
task_date = 'tuesday'
if weeknumber >= 4 and weeknumber <= 5:
task_date = 'thursday'
return {'task_date': task_date}
@hitalos
hitalos / 1_create_tables.down.sql
Last active January 31, 2019 16:07
Exemplo de uso da função `StructScan` do pacote sqlx
DROP TABLE IF EXISTS items;
DROP TABLE IF EXISTS categories;
DROP TABLE IF EXISTS menus;