Skip to content

Instantly share code, notes, and snippets.

@nbogie
nbogie / problem.component.ts
Last active July 5, 2016 23:59
Attempted recreation of @anuteja 's problem.
//Working towards a minimal demonstration of the problem.
//This currently works as expected :(
import { Component } from '@angular/core';
@Component({
moduleId: module.id,
selector: 'problem',
styles: [`
.original { color: green; }
.different { color: orange; }
`],
@nbogie
nbogie / midipipe-youtube-midi-control.applescript
Last active February 13, 2017 22:31
applescript and js for midipipe to play/pause youtube video in chrome via a midi event.
on runme(message)
tell application "Google Chrome"
if (item 1 of message = 191) then
# Play or pause a video.
repeat with t in tabs of windows
tell t
@nbogie
nbogie / midipipe-youtube-midi-control-advanced.applescript
Last active February 13, 2017 22:32
midipipe midi youtube playback controller applescript. This one maps a continuous controller's value to the playback speed.
on runme(message)
tell application "Google Chrome"
if (item 1 of message = 191) then
# Play or pause a video.
repeat with t in tabs of windows
tell t
@nbogie
nbogie / midipipe-youtube-midi-control-advanced-with-seek.applescript
Last active February 2, 2018 04:42
Applescript (for Midipipe) to control playback of youtube, vimeo, netflix, etc (in chrome), via MIDI device. Allows control of playback position, volume, playback speed, as well as play/pause, from midi messages.
#returns true if the message represents a positive change of
# the given controller number, as will happen when depressing buttons a midi keyb.
# We ignore messages with value bytes 0, as those are sent on button releases.
on isMidiButtonPressed(msg, controllerNumber)
return (isControlChange(msg, controllerNumber) and (item 3 of msg > 0))
end isMidiButtonPressed
on isControlChange(msg, controllerNumber)
return ((item 1 of msg = 191) and (item 2 of msg = controllerNumber))
end isControlChange
@nbogie
nbogie / midipipe-amazon-music-control.applescript
Created February 16, 2017 09:32
simple applescript for midipipe, to allow MIDI control of amazon music player in Chrome
on isMidiButtonPressed(msg, bNumber)
return ((item 1 of msg = 191) and (item 2 of msg = bNumber) and (item 3 of msg > 0))
end isMidiButtonPressed
on jsClick(theTab, sel)
tell application "Google Chrome"
execute theTab javascript ("document.querySelector('" & sel & "').click()")
end tell
end jsClick
@nbogie
nbogie / midipipe-vlc-midi-control.applescript
Last active February 23, 2017 08:07
applescript (for midipipe) for MIDI control of VLC. Very basic due to VLC's limited applescript dictionary.
#VLC is bad at being controlled by applescript.
# Consider instead using Transcribe! for studying videos - it offers lots of midi control.
#returns true if the message represents a positive change of
# the given controller number, as will happen when depressing buttons a midi keyb.
# We ignore messages with value bytes 0, as those are sent on button releases.
on isMidiButtonPressed(msg, controllerNumber)
return (isControlChange(msg, controllerNumber) and (item 3 of msg > 0))
end isMidiButtonPressed
YO! Sushi specialises in delivering sushi to customers using the Japanese style 'kaiten' conveyor belt method. In each restaurant various sushi dishes and other Japanese cooked foods are prepared in a theater style kitchen in plain view of customers and then set on the thin conveyor belt. The belt carries food around the restaurant in a circuit, allowing diners to pick any dish from the belt. In order to indicate freshness, a label is applied to the lid of the dish to indicate when the dish must be consumed by.
The restaurants are mostly based in the United Kingdom with the majority in London.[9] Restaurants have also been opened in the Middle East in Dubai,[10][dead link] Saudi Arabia, Bahrain and Kuwait, with others in other countries such as Russia and Ireland. In the United States, YO! Sushi has opened five restaurants: There is a YO! Sushi located at the Westfield Garden State Plaza shopping mall in Paramus, New Jersey, which is close to New York City.
@nbogie
nbogie / microbit theremin
Last active September 28, 2017 23:58
us-100 ultrasonic theremin on microbit. Uses fizban99's code to get distance.
from microbit import uart, pin14, pin15, pin2, pin1, pin0, sleep, display
from sys import print_exception
import music
#This is a simplified version of the library here:
# https://github.com/fizban99/microbit_us100
#
# TODO: Perhaps see the above for exception handling.
class US100:
@nbogie
nbogie / TeensyAudioFirstSynth.ino
Created October 10, 2017 23:30
A quick first noisemaker patch with Teensy Audio library and a single pot.
#include <synth_simple_drum.h>
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioSynthWaveformSine sine1; //xy=69.01041030883789,238.01041412353516
AudioSynthKarplusStrong string1; //xy=114.01040649414062,78.01041412353516