Skip to content

Instantly share code, notes, and snippets.

Creating awesome audio software and things!

Jonathan Silverman mixflame

Creating awesome audio software and things!
View GitHub Profile
View convertToWav.m
// convertToWav.m
// MixDJ
// Created by Jonathan Silverman on 2/26/19.
// Copyright © 2019 Jonathan Silverman. All rights reserved.
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
View gist:024703c4dcb226ace189c8e6379e20f1
AudioChannelLayout channelLayout;
memset(&channelLayout, 0, sizeof(AudioChannelLayout));
channelLayout.mChannelLayoutTag = kAudioChannelLayoutTag_Stereo;
NSDictionary *outputSettings =
[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:kAudioFormatLinearPCM], AVFormatIDKey,
[NSNumber numberWithFloat:44100.0], AVSampleRateKey,
[NSNumber numberWithInt:2], AVNumberOfChannelsKey,
[NSData dataWithBytes:&channelLayout length:sizeof(AudioChannelLayout)],
View gist:c83f52e238d5d2040e1f
D/com/yourcompany/hello2( 9658): Loading payload
D/com/yourcompany/hello2( 9658): RubyVM 0x4806f300 created
D/com/yourcompany/hello2( 9658): Initializing RubyMotion runtime (environment: development)
W/dalvikvm( 9658): JNI WARNING: JNI method called with exception pending
W/dalvikvm( 9658): in Ljava/lang/Runtime;.nativeLoad:(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/String; (GetMethodID)
W/dalvikvm( 9658): Pending exception is:
I/dalvikvm( 9658): java.lang.NoClassDefFoundError: com/rubymotion/Hash
I/dalvikvm( 9658): at java.lang.Runtime.nativeLoad(Native Method)
I/dalvikvm( 9658): at java.lang.Runtime.nativeLoad(Native Method)
I/dalvikvm( 9658): at java.lang.Runtime.loadLibrary(
View gist:8344423
1. Self-signed certificates will not work without help. Expired certificates will not work at all.
The secret: You has to add the certificate to the configuration profile and install it with Iphone Configuration Utility.. the cert cannot be expired or untrusted. If its untrusted you need to trust always in Keychain Access. The device MUST be plugged in, this cannot be done wirelessly. Make sure you install the configuration profile you created with the certs.
2. Do not use xhr.js and Weinre at the same time. They conflict and neither will work.
mixflame / rails_2_rails_4_flash_sharing.rb
Last active Dec 31, 2015
Share flash between Rails 2 and Rails 4 with monkey patches! Works both ways with sweeping! If you actually have this problem, *facepalm*
View rails_2_rails_4_flash_sharing.rb
# Rails
# vendor/bundle/ruby/1.8/gems/actionpack-
# Access the contents of the flash. Use <tt>flash["notice"]</tt> to read a notice you put there or
# <tt>flash["notice"] = "hello"</tt> to put a new one.
# Note that if sessions are disabled only will work.
def flash(refresh = false) #:doc:
if !defined?(@_flash) || refresh
@_flash =
if session.is_a?(Hash)
View gist:4186558
Jonathans-MacBook-Pro:GlobalChat2 jsilverman2$ ruby GChat_2_server.rb
// ERROR: NoMethodError: undefined method `sexp_type' for nil:NilClass in s(:defn, :broadcast, s(:args, :message, :sender), s(:scope, s(:block, s(:if, s(:call, s(:lvar, :sender), :nil?), s(:lasgn, :sender, s(:nil)), nil), s(:iter, s(:call, s(:ivar, :@mutex), :synchronize, nil), s(:dasgn_curr, :temp_1), s(:iter, s(:call, s(:ivar, :@sockets), :each, nil), s(:dasgn_curr, :socket), s(:rescue, s(:if, s(:call, s(:dvar, :socket), :==, s(:arglist, s(:lvar, :sender))), nil, s(:call, nil, :sock_send, s(:arglist, s(:dvar, :socket), s(:lvar, :message)))), s(:resbody, nil, s(:block, s(:call, nil, :log, s(:arglist, s(:str, "broadcast fail removal event"))), s(:call, nil, :remove_dead_socket, s(:arglist, s(:dvar, :socket))))))))))) from /Library/Ruby/Gems/1.8/gems/ParseTree-2.0.0/lib/sexp_processor.rb:291:in `call', /Library/Ruby/Gems/1.8/gems/ParseTree-2.0.0/lib/sexp_processor.rb:291:in `error_handler', /Library/Ruby/Gems/1.8/gems/ParseTree-2.0.0/lib/se
View gist:4185682
rbx 2.0 for gc2 server:
454.808594 Mb /home/globalchat/.rvm/rubies/rbx-head/bin/ruby /home/globalchat/ServDrop/bin/server.rb 38139 PineChat false true
559.402344 Mb ruby server.rb
any way to minimize memory usage? perhaps use only 1 rbx for all servers?
View gist:4185211
globalchat@li554-206:~$ free -m
total used free shared buffers cached
Mem: 486 407 79 0 35 305
-/+ buffers/cache: 66 420
Swap: 255 9 246
View gist:4185119
Last login: Sat Dec 1 21:00:00 2012 from
globalchat@li554-206:~$ free -m
total used free shared buffers cached
Mem: 486 88 398 0 4 36
-/+ buffers/cache: 47 439
Swap: 255 0 255
View gist:4184087
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes