Skip to content

Instantly share code, notes, and snippets.

View stefa168's full-sized avatar
📚
Busy with exams, as usual

Stefano Vittorio Porta stefa168

📚
Busy with exams, as usual
  • Asti, Italy
View GitHub Profile
@aras-p
aras-p / preprocessor_fun.h
Last active June 21, 2024 12:20
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,
@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();
@goldsborough
goldsborough / postgres.py
Created September 3, 2014 10:09
Python psycopg2 wrapper
###########################################################################
#
## @file postgres.py
#
###########################################################################
import psycopg2
###########################################################################
#
@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. ...
@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);
}
@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

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 26, 2024 18:43
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

@0xallie
0xallie / lossless-stream-rip-cheatsheet.md
Last active April 27, 2024 04:41
Lossless stream rip cheatsheet

Lossless stream rip cheatsheet

Note: This guide may be slightly outdated. It may be still useful for older releases, but nowadays the vast majority of releases are correctly tagged as WEB-DL (unless it's RARBG/rartv). Protip: prefer looking at file names instead of release names, as they tend to be more accurate.

This is a short cheatsheet to help you determine whether a release from Amazon, Hulu, or Netflix contains the lossless/untouched (as in no further loss of quality compared to what the streaming services provide) video/audio or not. Most newer P2P releases are correctly tagged, but for older releases, it cannot be reliably determined based on the tags alone.

In most cases, non-lossless rips from these services are screen captures (which, when done by professional releasers, should be high quality and contain little to no glitches – see the history section for details), but in some cases they may be simply reencoded from the untouched stream, for example to crop black bars or reencode from a

@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
@aziraphale
aziraphale / config.txt
Created November 2, 2017 10:09
Smoothieboard BL Touch Configuration
gamma_min_endstop nc # Normally 1.28. Change to nc to prevent conflict,
## Z-Probe (BL Touch)
# See http://forum.smoothieware.org/forum/t-1760423/bltouch-support#post-2712545
# And http://smoothieware.org/zprobe#bltouch-or-servo-retractable-touch-probe
zprobe.enable true # set to true to enable a zprobe
zprobe.probe_pin 1.28 # pin probe is attached to if NC remove the !
zprobe.slow_feedrate 5 # mm/sec probe feed rate
zprobe.fast_feedrate 100 # move feedrate mm/sec
zprobe.probe_height 5 # how much above bed to start probe