Skip to content

Instantly share code, notes, and snippets.

View stefa168's full-sized avatar
πŸ‘”

Stefano Vittorio Porta stefa168

πŸ‘”
View GitHub Profile
@hemalchevli
hemalchevli / bluepill.cfg
Last active July 24, 2023 11:57
OpenOCD config file for Bluepill STM32F103C8T6
#source [find interface/stlink-v2-1.cfg]
source [find interface/stlink-v2.cfg]
transport select hla_swd
source [find target/stm32f1x.cfg]
#reset_config srst_only
reset_config none separate
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active March 29, 2026 16:17
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@domenic
domenic / redirecting-github-pages.md
Created February 10, 2017 19:28
Redirecting GitHub pages after a repository move

Redirecting GitHub Pages after a repository move

The problem

You have a repository, call it alice/repo. You would like to transfer it to the user bob, so it will become bob/repo.

However, you make heavy use of the GitHub Pages feature, so that people are often accessing https://alice.github.io/repo/. GitHub will helpfully redirect all of your repository stuff hosted on github.com after the move, but will not redirect the GitHub Pages hosted on github.io.

The solution

@acdcjunior
acdcjunior / UnitOfWork.java
Last active May 3, 2020 16:03
UnitOrWork + DAO + EntityManager programatic transaction handling suggestion
// NOTE: This is not a by-the-book implementation of the UnitOfWork pattern. If you don't feel it is
// OK, then you can call this class Transaction or anything like that
public class UnitOfWork {
// static reference to entityManagerFactory
public static UnitOfWork createUnitOfWork() {
EntityManager entityManager = entityManagerFactory.createEntityManager();
return new UnitOfWork(entityManager);
}
@fourcube
fourcube / UseCase-Template
Created January 7, 2015 10:51
Markdown Template for describing Use Cases
Use Case 1: (Target) Title (Type)
=================================
**Primary Actor**: User
**Scope**: Software system
**Level**: Summary / User Goal
Main success scenario:
----------------------
1. ...
2. ...
@goldsborough
goldsborough / postgres.py
Created September 3, 2014 10:09
Python psycopg2 wrapper
###########################################################################
#
## @file postgres.py
#
###########################################################################
import psycopg2
###########################################################################
#
@Munkkeli
Munkkeli / MeshGenerator.cs
Last active August 29, 2015 14:01
Unity - Simple Mesh Generation
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer), typeof(MeshCollider))]
public class MeshGeneration : MonoBehaviour {
// Use this for initialization
void Awake () {
CreateMesh();
@aras-p
aras-p / preprocessor_fun.h
Last active March 20, 2026 15:26
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,