Skip to content

Instantly share code, notes, and snippets.

@rraallvv
rraallvv / MultichannelCoreMidiExample.cpp
Last active January 1, 2022 11:10
Multichannel CoreMidi Example
#include <iostream>
#include <AudioToolbox/AudioToolbox.h>
#include "CAComponent.h"
int main (int argc, char * const argv[]) {
AUGraph graph;
AUNode outputNode, mixerNode, dlsNodeA, dlsNodeB, dlsNodeC;
AudioUnit dlsA, dlsB, dlsC;
//Setup Graph
@rraallvv
rraallvv / SimpleMidiInSetup.cpp
Created February 1, 2016 02:58
Simple Midi In Setup
#include <iostream>
#include <AudioToolbox/AudioToolbox.h>
int main (int argc, char * const argv[]) {
AUGraph graph;
AUNode outputNode, mixerNode, synthNode;
AudioUnit synthUnit;
//Setup Graph
NewAUGraph(&graph);
@rraallvv
rraallvv / code-auto-versioning.sh
Created February 9, 2016 11:35
Xcode build phase script for auto-versioning
# Xcode auto-versioning script for Subversion
# by Axel Andersson, modified by Daniel Jalkut to add
# "--revision HEAD" to the svn info line, which allows
# the latest revision to always be used.
# See http://www.red-sweater.com/blog/23/automatic-build-sub-versioning-in-xcode#finalscript
use strict;
die "$0: Must be run from Xcode" unless $ENV{"BUILT_PRODUCTS_DIR"};
@rraallvv
rraallvv / json-to-plist.sh
Created February 25, 2016 19:14 — forked from sugarmo/json-to-plist.sh
A shell script for Automator that can convert JSON to .plist file.
for f in "$@"
do
filename="${f%.*}"
plutil -convert xml1 "$filename".json -o "$filename".plist
done
@rraallvv
rraallvv / XCodeReporter.js
Last active June 8, 2016 18:10 — forked from distractdiverge/XCodeReporter.js
A custom reporter for jshint to present errors in a format for XCode to read them.
module.exports = {
reporter: function (res) {
var len = res.length;
var str = "";
res.forEach(function (r) {
var file = r.file;
var err = r.error;
str += file + ":" + err.line + ": error: " + err.reason + "\n";
@rraallvv
rraallvv / copy.js
Created June 18, 2016 17:55
[Node.js] copy dir recursively
var fs = require('fs');
var copy = function(srcDir, dstDir) {
var results = [];
var list = fs.readdirSync(srcDir);
var src, dst;
list.forEach(function(file) {
src = srcDir + '/' + file;
dst = dstDir + '/' + file;
//console.log(src);
var stat = fs.statSync(src);
@rraallvv
rraallvv / audioaddict-premium-account-generator.sh
Last active June 24, 2016 19:01 — forked from hackruu/di-fm-premium-account-generator.sh
Generate premium account and playlists.
#!/bin/bash
AGENT="AudioAddict-di/1.4.7 iOS/8.1"
COOKIES="./cookies.txt"
AUTH="ephemeron:dayeiph0ne@pp"
DOMAIN=gmail.com
PLAYLISTDI="di.fm.m3u"
PLAYLISTSKY="sky.fm.m3u"
PLAYLISTJAZZ="jazzradio.m3u"
PLAYLISTROCK="rockradio.m3u"
JSONDI="http://listen.di.fm/premium_high.json"
@rraallvv
rraallvv / WebViewEditorWindow.cs
Created October 21, 2016 12:58
Using gree's unity-webview in EditorWindow
# Using gree's unity-webview in EditorWindow
# https://github.com/gree/unity-webview
using UnityEditor;
using UnityEngine;
public class WebViewEditorWindow : EditorWindow
{
static GameObject go;
static WebViewObject wvo;
@rraallvv
rraallvv / TwitterWindow.cs
Created October 21, 2016 13:06
Using the built-in Unity's in-editor WebView
// Using the built-in Unity's in-editor WebView
using UnityEditor;
using UnityEngine;
using System.Reflection;
// cf. http://qiita.com/kyusyukeigo/items/a7d3940b95c4ec224d12 (in Japanese)
public class TwitterWindow : ScriptableObject
{
[MenuItem("Window/Twitter")]
@rraallvv
rraallvv / downloader.sh
Created November 3, 2016 22:56
Quick and dirty files downloader
#!/bin/bash
remotepath="http://www.example.com"
urldecode() {
# urldecode <string>
local url_encoded="${1//+/ }"
printf '%b' "${url_encoded//%/\\x}"
}