Skip to content

Instantly share code, notes, and snippets.

Alessandro Balzano alfateam123

Block or report user

Report or block alfateam123

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
alfateam123 / Makefile
Created Nov 6, 2019
Experimenting with Value Structs...
View Makefile
all: test-template test-structs test-raw \
assembly-raw-float.s assembly-value-struct.s \
test-template: vstr-template.cpp
g++ -O2 -Wall -Wextra -o test-template vstr-template.cpp
test-structs: value-struct.cpp
g++ -O2 -Wall -Wextra -o test-structs value-struct.cpp
alfateam123 /
Created Apr 30, 2019
lifejournal script - daily log from the command line (vim + git)
#!/usr/bin/env bash
cd $HOME/projects/lifejournal
today=$(date +%Y%m%d-%H%M%S)
vim "${new_fname}"
if [ -e $new_fname ]; then
alfateam123 / data.dzn
Created Jan 25, 2019
Emptying cashless keys with MiniZinc
View data.dzn
START_AMOUNT = 260; % 2.60 euro
BEVERAGES = { coffee, tea, ginseng, chocolate };
COST = [ 25, 40, 35, 30 ];
alfateam123 / enzyme-react-intl.d.ts
Last active Jul 18, 2018
View enzyme-react-intl.d.ts
declare module "enzyme-react-intl" {
import {Component, ReactElement} from "react";
import {MountRendererProps, ReactWrapper} from "enzyme";
export function loadTranslation(localeFilePath: string): { [key: string]: string };
export function loadTranslationObject(translations: { [key: string]: string }): { [key: string]: string };
export function shallowWithIntl<C extends Component, P = Component["props"], S = Component["state"]>(
node: ReactElement<P>): ReactWrapper<P, S, C>;
View nice_loop.rb
live_loop :arp do
play (scale :e3, :minor_pentatonic).tick,
release: 0.20,
amp: 0.25
sleep 0.125
live_loop :pippo do
alfateam123 / cargo.txt
Last active Aug 17, 2017
problem with early returns in rust - `if` without `else` that returns a value
View cargo.txt
Compiling rust_problem v0.1.0 (file:///home/winter/projects/rust_problem)
error[E0308]: mismatched types
--> src/
3 | None
| ^^^^ expected (), found enum `std::option::Option`
= note: expected type `()`
found type `std::option::Option<_>`
alfateam123 /
Created May 27, 2017
Script to merge conflicted Keepass Classic .xml exports in a single .xml file
from xml.dom import minidom
from collections import namedtuple
import os
PwEntry = namedtuple("PwEntry", [
alfateam123 /
Last active Sep 6, 2019
Random funny quotes I find while reading blogposts or source code

This is a collection of some funny quotes

Unix: just enough potholes and bear traps to keep an entire valley going.

from Rachel By The Bay

Hacking around with private methods like this is juggling footguns

comment found inside app-route source code (2016?). By the way, the code still works as expected.

Tricky Akka mocks make Jenkins kaboom

Example sentence for the fantasque-sans font

alfateam123 /
Created Jan 10, 2017
script per il tagging di <polygon> in un .svg
from xml.dom import minidom
SRC_FILE = "public/images/macchina.svg"
DST_FILE = "public/images/fuffa.svg"
with open(SRC_FILE) as source:
doc = minidom.parse(source)
svg_elem = doc.childNodes[0]
alfateam123 /
Created Dec 1, 2016
simple script to extract all <dom-module> Polymer component definitions from a vulcanized file.
# usage: python
# parses a file called `vulcanized.html` and splits it
# into several files, separated in different folders
# according to the `assetpath` attribute.
# it does not create the folders, though: look for IOErrors and OSErrors
# inside the traceback.
# requires beautifulsoup4
from bs4 import BeautifulSoup
You can’t perform that action at this time.