View pattern_looping_osc_handlers.lua
-- Assumes messages are sent from TouchOSC buttons and include extraneous values
-- The values are parsed by Renise but ignore by the handler code
local global_current_set_pattern = 1
local function set_pattern_loop(pattern_num)
renoise.song().transport:set_scheduled_sequence(pattern_num)
renoise.song().transport.loop_pattern = true
end
add_global_action {
View Convert audio to video with ffmpeg - examples.md

Convert audio to video with ffmpeg - examples

avectorscope

ffmpeg -i input.mp3 -filter_complex "[0:a]avectorscope=s=1920x1080,format=yuv420p[v]" -map "[v]" -map 0:a avectorscope.mp4

showcqt

ffmpeg -i input.mp3 -filter_complex "[0:a]showcqt=s=1920x1080,format=yuv420p[v]" -map "[v]" -map 0:a showcqt.mp4

ahistogram

ffmpeg -i input.mp3 -filter_complex "[0:a]ahistogram=s=1920x1080,format=yuv420p[v]" -map "[v]" -map 0:a ahistogram.mp4
View what-version-is-this-xrns.rb
#!/usr/bin/env ruby
require 'fileutils'
=begin
An xrns file is just a zip file with a special file extension.
That archive holds a number of files. One of these is Song.xml.
This XML has a root element with an attribute named 'doc_version'
View simple-demo.xml
<?xml version="1.0" encoding="UTF-8"?>
<Mediator-Model Version="1" User="" TWO_Version="0.9.2">
<Model V="5" ID="TWO">
<Composite V="1" ID="Locations">
<OSC_Location V="2" ID="demo_location_0" Description="Demo sketch 0" Root_OSC_Address=""
Outgoing_IP="127.0.0.1" Outgoing_Port="7000" Incoming_Port="1000"/>
<OSC_Location V="2" ID="demo_location_1" Description="Location of the secnd demo sketch"
Root_OSC_Address="" Outgoing_IP="127.0.0.1" Outgoing_Port="7001"
Incoming_Port="1001"/>
View opt-parse-complete-example.rb
# This is based on code copied from https://bugs.ruby-lang.org/issues/12323
# to replace non-working example given in the rdocs for the OptionParser class
require 'optparse'
require 'optparse/time'
require 'ostruct'
require 'pp'
class OptparseExample
Version = '1.0.1'
View editing-files-in-lxss.md

Scenario: Wanting to add a virtualhost file to Apache2, which was installed using apt while in bash

Assumption: /etc/apache2 in bash maps to %HOME%\AppData\Local\lxss\rootfs\etc\apache2

  1. Opened a Windows-linux bash shell
  2. Installed apache2 (sudo apt-get install ...)
  3. Wanted to add a virtual host file that had been used on another dev machine
  4. Decided that editing files with vi in the bash terminal was too annoying :)
  5. Found the matching "sites-available" folder via Win10 File Explorer.
  6. Copied an existing virtualhost file itno that folder
View random_string_using_char_set.rb
def random_string_using_char_set len, chars
(0...len).map { chars[rand(chars.size)] }.join
end
safe_chars = (('A'..'Z').to_a + ('a'..'z').to_a + ('3'..'9').to_a ) - %w{5 S Z l o O}
some_string = random_string_using_char_set 50, safe_chars
p some_string
View one-shot-osc.rb
#!/usr/bin/env ruby
require 'osc-ruby-ng'
if ARGV.empty?
puts "Usage: #{__FILE__} <adddress>:<port> <address_pattern> [args ...]"
exit
end
def arg_to_type a
View thenewyorker-email.html
------=_Part_19856_1401403311.1448656482155
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org=
/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns=3D"http://www.w3.org/1999/xhtml">
<head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF=
-8"><meta name=3D"format-detection" content=3D"telephone=3Dno"><meta name=
View TeensyBluefriendDemo.ino
/*!
@file bleuart_datamode.ino
@author hathach, ktown (Adafruit Industries)
This demo will show you how to initialize the module in COMMAND mode then
send data in DATA mode, uses the MODE pin
Altered to work with a Teensy 3.1 using Serial2
The Bluefruit CTS pin is connected to Teensy pin 8.