Skip to content

Instantly share code, notes, and snippets.

View nperony's full-sized avatar

Nico Perony nperony

View GitHub Profile
@nperony
nperony / call_recording_instructions.md
Last active January 22, 2020 08:45
Recording simultaneous bi-directional raw audio streams (e.g. calls) on OS X

Recording simultaneous bi-directional raw audio streams (e.g. calls) on OS X


Steps

  1. Install kernel module to mirror speaker/headphones audio onto input interface
  2. Create a virtual "multi-output" device to pipe audio output simultaneously to speakers/headphones and input interface
  3. Create a virtual "aggregate" device to multiplex output/input audio channels
  4. Record audio file
  5. Blend channels, normalise audio, export stereo file.
@nperony
nperony / Code.gs
Created April 11, 2017 15:12
Google Apps Script to export the content of a spreadsheet to JSON
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@nperony
nperony / crawl_followers.py
Created November 23, 2016 13:24
Crawling profiles in Facebook (or Workplace) community to get list of followers
# Facebook login to get the list of members for every follower
from selenium import webdriver
from selenium.webdriver.support import ui
from selenium.webdriver.common.keys import Keys
def page_is_loaded(driver):
return driver.find_element_by_tag_name("body") != None
driver = webdriver.Chrome()
@nperony
nperony / map.html
Last active November 23, 2016 07:56
Interactive map interface in HTML/JavaScript
<!-- Full project code and assets at https://github.com/slowmotionprojects/green-education-center -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="GEC China challenge map">
<link rel="stylesheet" href="style.css" />
@nperony
nperony / lamp_loop_2_cycles.ino
Created November 23, 2016 06:25
Arduino code (C) to control an 8-relay board
//Project page: https://github.com/slowmotionprojects/green-education-center
int pinArray[] = {2,3,4,5,6,7,8,9}; // define the pins that will connect to the relays
int cycle1LengthMs = 12000; // how long each lamp stays on in the first cycle
int cycle2LengthMs = 1000; // how long each lamp stays on in the second cycle
void setup() {
for (int i = 0; i < (sizeof(pinArray)/sizeof(int)); i++){
pinMode(pinArray[i],OUTPUT);