Skip to content

Instantly share code, notes, and snippets.

View dallarosa's full-sized avatar

Francisco Dalla Rosa Soares dallarosa

View GitHub Profile
jupyterhub --config=/etc/jupyterhub/jupyterhub_config.py
package main
import (
"encoding/hex"
"fmt"
)
func main() {
msg := "73616d706c652074657874"
bs, err := hex.DecodeString(msg)
@dallarosa
dallarosa / spectogram.py
Last active July 20, 2018 03:26
Spectogram images from audio for machine learning
#Based on http://www.frank-zalkow.de/en/code-snippets/create-audio-spectrograms-with-python.html
#This work is licensed under Creative Commons Attribution 3.0 International(Unported), according to the original work.
#Original Author: Frank Zalkow
#This Version's Author: Francisco Dalla Rosa Soares
import numpy as np
from matplotlib import pyplot as plt
import scipy.io.wavfile as wav
from numpy.lib import stride_tricks
import math
@dallarosa
dallarosa / install_jupyter.sh
Created March 6, 2018 09:31
Install jupyter and jupyterhub
pip3 install --upgrade notebook jupyterhub
@dallarosa
dallarosa / gist:7e3c6b48e6c54d32f19f24a5b95ac389
Last active March 6, 2018 09:20
install python3 and pip3
apt install python3 python3-pip
@dallarosa
dallarosa / challenge_skeleton.go
Created September 30, 2016 06:52
skeleton for any programming challenge
package main
import(
"fmt"
"bufio"
"os"
)
func main() {
reader := bufio.NewReader(os.Stdin)
.
.
.
<link rel="import" href="../bower_components/app-localize-behavior/app-localize-behavior.html">
.
.
.
<a name="view1" href="/view1">{{localize('hello','a','Batman')}}</a>
.
.
@dallarosa
dallarosa / check_spk.sh
Created November 1, 2015 16:35
Start chrome outputting sound to the soft volume device when the bluetooth speaker is connected
#!/usr/bin/bash
/usr/bin/hcitool con | grep -o 'DEVICE_MAC_ADDRESS' &> /dev/null
if [ $? -eq 0 ]
then PATH_TO_CHROME --alsa-output-device=softvol "$@"
else PATH_TO_CHROME
fi
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
char * int2bin(int i)
{
size_t bits = sizeof(int) * CHAR_BIT;
char * str = malloc(bits + 1);
if(!str) return NULL;
package main
import (
"io/ioutil"
"log"
"strings"
)
func main() {
input, err := ioutil.ReadFile("myfile")