Skip to content

Instantly share code, notes, and snippets.

View brescia123's full-sized avatar

Giacomo Bresciani brescia123

View GitHub Profile
@brescia123
brescia123 / sign_apk.gradle
Last active October 27, 2015 13:41
Configuration to generate a signed apk from the command line
signingConfigs {
releaseSigning {
storeFile file(System.getenv("ANDROID_KEYSTORE"))
storePassword System.console().readPassword("\nStore password: ").toString()
keyAlias System.getenv("ANDROID_KEYALIAS")
keyPassword System.console().readPassword("Key password: ").toString()
}
}
buildTypes {
@brescia123
brescia123 / latex_commands.tex
Created September 29, 2015 08:21
Useful commands for Latex
\definecolor{light-gray}{gray}{0.95}
\definecolor{yellow}{RGB}{255, 251, 140}
% single line code blocks with monospace font and light-gray background (StackOverflow style)
\newcommand{\code}[1]{\colorbox{light-gray}{\texttt{#1}}}
% note command
\newcommand{\todo}[1]{\colorbox{yellow}{\textbf{\#TODO} #1}}
@brescia123
brescia123 / send_file_nc.sh
Created September 29, 2015 08:16
Commands to send a file with Netcat
# Listening
nc -l -p 1234 > out.file
# Sending
nc -w 3 [destination] 1234 < out.file
@brescia123
brescia123 / aggr_collector.py
Last active August 29, 2015 14:17
A script for collecting data aggregates from multiple simulations run with aDock - affear.github.io/adock
from firebase import firebase
import json
bifrost = firebase.FirebaseApplication('https://bifrost.firebaseio.com/', None)
sims = bifrost.get('/sims', None)
avgs = {}
for sim in sims: