Skip to content

Instantly share code, notes, and snippets.

View tiagopog's full-sized avatar

Tiago Guedes tiagopog

View GitHub Profile
@qoomon
qoomon / conventional_commit_messages.md
Last active May 8, 2024 09:48
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@aras-p
aras-p / preprocessor_fun.h
Last active May 8, 2024 06:45
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@chetan
chetan / yardoc_cheatsheet.md
Last active May 4, 2024 11:12
YARD cheatsheet
@kelvinst
kelvinst / git-aliases.md
Last active April 7, 2024 20:30
Git alias - seja rápido, seja breve!

Git alias - seja rápido, seja breve!

Git freak como sou, precisava compartilhar algo útil sobre ele, claro. E, já que não vejo muito por aí o pessoal usando, resolvi falar dos alias do git! É um recurso que eu uso muito, e nunca entendi porque muitas pessoas não são adeptas. 😕

Pelo nome você já deve perceber que os alias no git são atalhos. Atalhos pro quê? São atalhos para comandos do git e até comandos shell se você quiser. E é bem fácil cadastrar um alias:

$ git config --global alias.st status
@maurobaraldi
maurobaraldi / bovespa_intraday.py
Last active March 28, 2024 09:41
Cotações da Bovespa Intraday
#!/usr/bin/env python
from datetime import datetime
from json import loads
from time import gmtime, mktime, strptime
# LevelDict é um wrapper usando dicionário para LevelDB
# https://github.com/maurobaraldi/leveldict
from leveldict import LevelJsonDict
from requests import get
@gbuesing
gbuesing / ml-ruby.md
Last active February 28, 2024 15:13
Resources for Machine Learning in Ruby

UPDATE a fork of this gist has been used as a starting point for a community-maintained "awesome" list: machine-learning-with-ruby Please look here for the most up-to-date info!

Resources for Machine Learning in Ruby

Gems

@O-I
O-I / weighted_random_sampling.md
Last active February 21, 2024 19:02
[TIx 8] Weighted Random Sampling in Ruby

One of the many reasons I love working with Ruby is it has a rich vocabulary that allows you to accomplish your goals with a minimal amount of code. If there isn't a method that does exactly what you want, it's usually possible to build an elegant solution yourself.

Let's take the example of simulating the rolling of a die.

We can represent a die as an array of its faces.

die = [*?⚀..?⚅]
# => ["⚀", "⚁", "⚂", "⚃", "⚄", "⚅"]
@Nagyman
Nagyman / workflows-in-django.md
Last active January 27, 2024 08:29
Workflows in Django

Workflows (States) in Django

I'm going to cover a simple, but effective, utility for managing state and transitions (aka workflow). We often need to store the state (status) of a model and it should only be in one state at a time.

Common Software Uses

  • Publishing (Draft->Approved->Published->Expired->Deleted)
@igrigorik
igrigorik / github.bash
Last active December 22, 2023 23:55
Open GitHub URL for current directory/repo...
alias gh="open \`git remote -v | grep git@github.com | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\`"
@rtgibbons
rtgibbons / logger.js
Created November 7, 2013 13:51
Logger Library with winston
var app = require(process.cwd() + '/app');
var winston = require('winston');
var _ = require('lodash');
// Set up logger
var customColors = {
trace: 'white',
debug: 'green',
info: 'green',
warn: 'yellow',