Skip to content

Instantly share code, notes, and snippets.

View dcalacci's full-sized avatar
🦩
wfh baby

Dana Calacci dcalacci

🦩
wfh baby
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dcalacci
dcalacci / export_google_music.js
Last active August 2, 2022 15:15 — forked from jmiserez/export_google_music.js
Export your Google Music Library and Playlists (Google Play Music All Access) (see http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music for more)
// Jeremie Miserez <[email protected]>, 2015
//
// A little bit of Javascript to let you export your Google Music library, playlists, and album track lists :)
//
// I posted this as an answer here: http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music
//
// 1. Go to: https://play.google.com/music/listen#/all (or your playlist)
//
// 2. Open a developer console (F12 for Chrome). Paste
// code below into the console.
@dcalacci
dcalacci / server-connection.js
Created January 30, 2016 22:12
server connection for yan!
var url = "18.85.24.150:3000";
// set up raw socket for custom events.
var socket = io.connect(url, {'transports': [
'websocket',
'flashsocket',
'jsonp-polling',
'xhr-polling',
'htmlfile'
]});
pieWidth = 300
pieHeight = 300
window.pie = null
window.pie = new PieChart [{'participantId': 'participant1',
'secondsSpoken': 5},
{'participantId': 'participant2',
'secondsSpoken': 10}], pieWidth, pieHeight
@dcalacci
dcalacci / temp-power-control.ino
Created October 21, 2015 02:17
temperature control power
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 9
#define TEMPERATURE_PRECISION 9
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
@dcalacci
dcalacci / band pass filter
Created May 15, 2015 16:48
band pass filter on 1s of data, returning a list of average amplitudes for each 100ms of data in a 1s sample.
import numpy as np
from scipy.signal import butter, lfilter, freqz, medfilt
from collections import namedtuple
def butter_bandpass(lowcut, highcut, fs, order=5):
nyq = 0.5 * fs
low = lowcut / nyq
high = highcut / nyq
b, a = butter(order, [low, high], btype='band')
Verifying I am +dcalacci on my passcard. https://onename.com/dcalacci
@dcalacci
dcalacci / first foray
Last active August 29, 2015 14:16
testing networks
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
@dcalacci
dcalacci / gist:39de37ed993f23c86b55
Created November 14, 2014 01:21
resampling PCM audio
from scipy.signal import resample
def resample_pcm(samplerate, channels, resample_rate=RESAMPLE_RATE):
"""Resamples the given PCM stream to resample_rate.
"""
new_length = resample_rate * (len(channels) / samplerate)
# convert to int so we have more exact matches
return resample(channels, new_length).astype(int)