Skip to content

Instantly share code, notes, and snippets.

View weibeld's full-sized avatar

Daniel Weibel weibeld

View GitHub Profile
@weibeld
weibeld / dbm_table.pdf
Last active December 10, 2015 10:19
A dBm to Milliwatts Conversion Table
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@weibeld
weibeld / weeks
Last active December 10, 2015 21:36
Print a sequence of dates in one-week intervals
#!/bin/bash
#
# Print sequence of dates in one-week intervals, starting from an initial date.
#
# Daniel Weibel <danielmweibel@gmail.com> October 2015
#------------------------------------------------------------------------------#
set -e
help() {
@weibeld
weibeld / gcc_arm32
Last active January 15, 2016 11:06
Compile a C program for an Android ARM 32-bit device
#!/bin/bash
#
# Compile a C program for Nexus 6 (or other device with an ARM 32-bit processor)
#
# Requirements:
# - Android NDK
#
# Daniel Weibel <danielmartin.weibel@polimi.it> January 2016
#------------------------------------------------------------------------------#
@weibeld
weibeld / note.cls
Created May 7, 2016 15:17
LaTeX class for simple short (or long) notes
% LaTeX class for simple short (or long) notes
%
% Usage: place .cls file in same directory as .tex file and reference class
% in .tex file with: \documentclass{note}
%
% Daniel Weibel <danielmartin.weibel@polimi.it> May 2016
%------------------------------------------------------------------------------%
\LoadClass[a4paper]{article}
@weibeld
weibeld / my_citorder.bst
Created May 27, 2016 13:20
BibTeX bibliography style with entries in citation order
% Begin of manually added comments
%------------------------------------------------------------------------------%
%
% The main characteristics of this bib style are:
% - Ordering of references in citation order
% - Author names: initials + surname (e.g. J. F. Smith)
% - Maximum three authors (missing names replaced by et al.)
% - Date as month + year
% - Titles (and punctuation) in double quotes
% - Don't change capitalisation of titles
@weibeld
weibeld / my_alphorder.bst
Created May 27, 2016 13:35
BibTex bibliography style with entries in alphabetical order
% Begin of manually added comments
%------------------------------------------------------------------------------%
%
% The main characteristics of this bib style are:
% - Ordering of references in alphabetical order
% - Author names: initials + surname (e.g. J. F. Smith)
% - Maximum three authors (missing names replaced by et al.)
% - Date as month + year
% - Titles (and punctuation) in double quotes
% - Don't change capitalisation of titles
@weibeld
weibeld / setTightMargins.m
Last active July 24, 2016 10:38
Remove superfluous margins from a Matlab figure
% Remove superfluous margins from current figure. This means that the figure
% borders will be directly adjacent to the outermost figure parts, e.g. axis
% labels, or title.
%
% The optional argument 'mrg' allows to specify a custom margin in centimeters.
% It must be either a single value, or a vector "[left bottom top right]".
%
% Call this function after creating the plot, before calling 'setCrop',
% and before calling 'print'.
%
@weibeld
weibeld / heroku_names.rb
Last active November 4, 2016 22:35
Heroku-like app names generator (https://gist.github.com/afriggeri/1266756)
# Usage: ruby heroku_names.rb
def adjectives
[
"autumn", "hidden", "bitter", "misty", "silent", "empty", "dry", "dark",
"summer", "icy", "delicate", "quiet", "white", "cool", "spring", "winter",
"patient", "crimson", "wispy", "weathered", "blue",
"billowing", "broken", "cold", "damp", "falling", "frosty", "green",
"long", "late", "bold", "little", "morning", "muddy",
"red", "rough", "still", "small", "sparkling", "shy",
@weibeld
weibeld / my_citorder.bst
Last active October 29, 2017 11:58
Custom BibTeX bibliography style with entries sorted in order of citation
% Begin of manually added comments
%------------------------------------------------------------------------------%
%
% The main characteristics of this bib style are:
% - Ordering of references in CITATION order
% - Author names: initials + surname (e.g. J. F. Smith)
% - Maximum three authors (missing names replaced by et al.)
% - Date as month + year
% - Titles (and punctuation) in double quotes
% - Don't change capitalisation of titles
@weibeld
weibeld / my_alphorder.bst
Last active October 29, 2017 11:58
Custom BibTeX bibliography style with entries sorted in alphabetical order
% Begin of manually added comments
%------------------------------------------------------------------------------%
%
% The main characteristics of this bib style are:
% - Ordering of references in ALPHABETICAL order
% - Author names: initials + surname (e.g. J. F. Smith)
% - Maximum three authors (missing names replaced by et al.)
% - Date as month + year
% - Titles (and punctuation) in double quotes
% - Don't change capitalisation of titles