Skip to content

Instantly share code, notes, and snippets.

@oiwn
oiwn / cycling_rename_track.lua
Last active April 25, 2024 09:14
Reaper DAW lua script to cycle through track names (now with support of all selected tracks!)
-- Define the list of names to cycle through
local trackNames = {"Drums", "Kick", "Hat", "Snare"}
-- Function to get the next name for the track
function getNextName(currentName)
for i, name in ipairs(trackNames) do
if name == currentName then
return trackNames[(i % #trackNames) + 1], (i % #trackNames) + 1
end
end
@oiwn
oiwn / audio-papers.md
Created April 16, 2023 04:38
Interesting audio related papers
"""Envparse is a simple utility to parse environment variables.
NOTE: can't remember where i got this code. slightly modified.
"""
import inspect
import json as pyjson
import logging
import os
import re
import shlex
import warnings
@oiwn
oiwn / usa_states_bound_boxes.json
Last active March 28, 2019 08:22 — forked from mishari/continental-usa-states-bb
Bounding box of states in USA from OSM's Nominatim (valid JSON file)
[{"place_id":"97994878","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"relation","osm_id":"161950","boundingbox":"30.1375217437744","35.0080299377441","-88.4731369018555","-84.8882446289062",,"lat":"33.2588817","lon":"-86.8295337","display_name":"Alabama, United States of America","place_rank":"8","category":"boundary","type":"administrative","importance":0.83507032450272,"icon":"http:\/\/nominatim.openstreetmap.org\/images\/mapicons\/poi_boundary_administrative.p.20.png"},
{"place_id":"97421560","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"relation","osm_id":"162018","boundingbox":"31.3321762084961","37.0042610168457","-114.818359375","-109.045196533203",,"lat":"34.395342","lon":"-111.7632755","display_name":"Arizona, United States of America","place_rank":"8","category":"boundary","type":"administrative","importance":0.83922181098242,"icon":"http:\/\/nominatim.openstree
@oiwn
oiwn / celery.sh
Created February 11, 2019 04:01 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@oiwn
oiwn / cities.json
Created August 16, 2018 02:28 — forked from Miserlou/cities.json
1000 Largest US Cities By Population With Geographic Coordinates, in JSON
[
{
"city": "New York",
"growth_from_2000_to_2013": "4.8%",
"latitude": 40.7127837,
"longitude": -74.0059413,
"population": "8405837",
"rank": "1",
"state": "New York"
},
@oiwn
oiwn / scrapers-server.org
Last active July 24, 2018 14:36
Scrapers

Boostrap

Ubuntu 16.04

Login to remote instance using ssh and install mosh and zsh shell. Default shell change require user password.

sudo apt-get install mosh
sudo apt-get install git-core apache2-utils
@oiwn
oiwn / async_app.py
Last active May 19, 2017 11:15 — forked from zbyte64/async_app.py
Asyncio Views With Django
import asyncio
from django import http
from django.core.urlresolvers import set_script_prefix
from django.utils.encoding import force_str
from django.core.handlers.wsgi import get_script_name
from django_wsgi.handler import DjangoApplication
import logging
import logging
import sys

Delete all containers/images

#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@oiwn
oiwn / libcurl_ubuntu_16_04
Last active April 17, 2018 19:50
Build curl library (tested on Ubuntu 16.04)
wget https://curl.haxx.se/download/curl-7.50.0.tar.gz
tar -zxvf curl-7.50.0.tar.gz
cd curl-7.50.0/
sudo apt install libc-ares-dev
sudo apt-get install libc-ares-dev
openssl version # check
./configure --with-ssl=/usr/local/ssl --enable-ares
make
sudo make install
curl --version