Skip to content

Instantly share code, notes, and snippets.

@pdesterlich
pdesterlich / nomi_italiani.txt
Last active January 6, 2024 11:15
lista nomi italiani
-- DISCLAIMER --
il presente elenco consiste in una raccolta di nomi presenti sul territorio italiano (non necessariamente "italiani")
viene generato prendendo processando automaticamente uno o più archivi anagrafici e non è controllato in alcun modo
è pertanto altamente possibile che ci siano errori o refusi
non è nè pretende di essere un elenco omnicomprensivo di tutti i nomi esistenti
----------------
abaco
abbondanza
abbondanzia
@pdesterlich
pdesterlich / cognomi.txt
Last active November 13, 2023 07:17
lista cognomi italiani
-- DISCLAIMER --
il presente elenco consiste in una raccolta di cognomi presenti sul territorio italiano (non necessariamente "italiani")
viene generato prendendo processando automaticamente uno o più archivi anagrafici e non è controllato in alcun modo
è pertanto altamente possibile che ci siano errori o refusi
non è ne pretende di essere un elenco omnicomprensivo di tutti i cognomi esistenti
----------------
abbondanza
abu
accadia
@ssp
ssp / flv-to-mp4.sh
Last active July 7, 2022 17:54
Command to repackage a MP4 video from a FLV container to a MP4 container.
#!/usr/bin/env sh
# Stored at: https://gist.github.com/4452136
# Assumes the given path points to a FLV file with MP4 video.
# Use ffmpeg to repackage the file.
ffmpeg -i "$1" -acodec copy -vcodec copy "$1".mp4
# old version:
# Not used anymore as VLC seems to have a bug that creates broken
@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@wduminy
wduminy / gist:6199987
Last active July 26, 2017 05:54
Shows how to make a cell in a JFace TableViewer look and act like a hyperlink
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Shell;
@TheHiddenHaku
TheHiddenHaku / CodiceFiscale.js
Last active January 10, 2024 16:47
Javascript function to check Italian Codice Fiscale
function codiceFISCALE(cfins)
{
var cf = cfins.toUpperCase();
var cfReg = /^[A-Z]{6}\d{2}[A-Z]\d{2}[A-Z]\d{3}[A-Z]$/;
if (!cfReg.test(cf))
{
return false;
}
var set1 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
@vanpeerdevelopment
vanpeerdevelopment / formatter-annotation.java
Last active August 22, 2021 07:17
Example of the use of the @Formatter:off and @Formatter:on annotations in eclipse to disable formatting for a piece of code.
public class Formatter {
/**
* The next piece of code is not formatted
* because of the @formatter annotations.
*/
// @formatter:off
public void nonFormattedMethod() {
int sum = 1 + 2 + 3 + 4 + 5;
}
@blackfalcon
blackfalcon / git-feature-workflow.md
Last active April 13, 2024 07:33
Git basics - a general workflow

Git-workflow vs feature branching

When working with Git, there are two prevailing workflows are Git workflow and feature branches. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited, and the focus of this article.

If you are new to Git and Git-workflows, I suggest reading the atlassian.com Git Workflow article in addition to this as there is more detail there than presented here.

I admit, using Bash in the command line with the standard configuration leaves a bit to be desired when it comes to awareness of state. A tool that I suggest using follows these instructions on setting up GIT Bash autocompletion. This tool will assist you to better visualize the state of a branc

@agoston
agoston / TransactionTemplate.java
Last active June 1, 2024 13:38
JdbcTemplate manual transaction example, using TransactionTemplate
//[... initialize ...]
final SimpleDataSourceFactory simpleDataSourceFactory = new SimpleDataSourceFactory("com.mysql.jdbc.Driver");
final DataSource dataSource = simpleDataSourceFactory.createDataSource(jdbcUrl, user, pass);
jdbcTemplate = new JdbcTemplate(dataSource);
final DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(dataSource);
transactionTemplate = new TransactionTemplate(transactionManager);
transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
@Liryna
Liryna / ARMDebianUbuntu.md
Last active May 20, 2024 15:04
Emulating ARM on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux