I hereby claim:
- I am niklasberglund on github.
- I am niklasb (https://keybase.io/niklasb) on keybase.
- I have a public key whose fingerprint is CC9F 8745 2524 4857 CC68 677A FC4E 552D E675 EC15
To claim this, I am signing this object:
| // | |
| // Based on https://gist.github.com/finder39/f6d71f03661f7147547d | |
| // NOTE: There's no CommonCrypto module for Swift. To make the import CommonCrypto line work do something like what's described in http://stackoverflow.com/a/29189873/257577 | |
| // | |
| import CommonCrypto | |
| extension String { | |
| /** | |
| Get the MD5 hash of this String | |
I hereby claim:
To claim this, I am signing this object:
This fork makes the code run on Mac OS X.
This Gist is about how I use PyAudio, NumPy, and Matplotlib to plot freqency spectrum of system sound or microphone.
You can read this blog post for more detail.
| #include "TargetConditionals.h" | |
| #include <ifaddrs.h> | |
| #include <arpa/inet.h> | |
| + (NSString *)deviceIPAddress | |
| { | |
| NSString *address = @"error"; | |
| struct ifaddrs *interfaces = NULL; | |
| struct ifaddrs *temp_addr = NULL; | |
| int success = 0; |
| # Get project directory path | |
| current_pwd="$PWD" | |
| project_dir=`cd "../../"; pwd` | |
| cd "$current_pwd" | |
| # Get .xcodeproj file path (yes I know it's not a file) | |
| project_file=`find "$project_dir" -maxdepth 1 -name "*.xcodeproj" | tail -1` |
| require 'xcodeproj' | |
| project_path = "your_project_path"; | |
| # Create project object | |
| project = Xcodeproj::Project.new(project_path); | |
| lib_path = "your_lib_path"; | |
| # Add the lib file as a reference | |
| libRef = project['Frameworks'].new_file(lib_path); |
| #import <Foundation/Foundation.h> | |
| @interface NSData (gzip) | |
| - (NSData *)gzipInflate; | |
| - (NSData *)gzipDeflate; | |
| @end |