Skip to content

Instantly share code, notes, and snippets.

@jheasly
jheasly / rtlsdr-osx.txt
Last active February 26, 2021 04:02 — forked from 0xabad1dea/rtlsdr-osx.txt
Build RTL-SDR on OSX with no tears using homebrew. Forked from https://gist.github.com/0xabad1dea/5777726, a macports solution.
rtl-sdr build notes for OSX
using macports http://www.macports.org/
see http://sdr.osmocom.org/trac/wiki/rtl-sdr
brew install cmake
brew install libusb
brew install pkgconfig
brew install sox # for easy audio
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
@r3econ
r3econ / ALAssetsLibrary+VideoOrientation.h
Created March 25, 2014 19:34
ALAssersLibrary category for getting the video's orientation.
@interface ALAssetsLibrary (VideoOrientation)
+ (UIInterfaceOrientation)orientationForTrack:(AVAsset *)asset;
@end
@olasd
olasd / stream_to_youtube.sh
Created March 28, 2014 19:58
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@r3econ
r3econ / gist:9953196
Created April 3, 2014 12:09
Posting JSON file using NSURLSession.
// URL of the endpoint we're going to contact.
NSURL *url = [NSURL URLWithString:@"http://localhost:8080/my.json"];
// Create a simple dictionary with numbers.
NSDictionary *dictionary = @{ @"numbers" : @[@1, @2, @3] };
// Convert the dictionary into JSON data.
NSData *JSONData = [NSJSONSerialization dataWithJSONObject:dictionary
options:0
error:nil];
@kirang89
kirang89 / model_relation_ex.py
Created April 7, 2014 18:59
Example for many-to-many relationship with extra columns in SQLAlchemy
import sqlalchemy
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import sessionmaker, relationship
engine = sqlalchemy.create_engine('sqlite:///:memory:')
Base = declarative_base()
@willrax
willrax / my_scene.rb
Last active August 29, 2015 14:01
Parallax scrolling with Sprite Kit and RubyMotion
# Video of it in action: http://cl.ly/VSIF
class MyScene < SKScene
def scroll_action(x, duration)
width = (x * 2)
move = SKAction.moveByX(-width, y: 0, duration: duration * width)
reset = SKAction.moveByX(width, y: 0, duration: 0)
SKAction.repeatActionForever(SKAction.sequence([move, reset]))
end
@xavriley
xavriley / auto_dubstep.rb
Created June 10, 2014 21:33
Auto generating dubstep with Sonic Pi
# DUBSTEP
# Combines ideas from my other gists
current_bpm = 140.0
use_bpm current_bpm
# WOBBLE BASS
define :wob do
use_synth :dsaw
lowcut = note(:E1) # ~ 40Hz
highcut = note(:G8) # ~ 3000Hz
@rgcottrell
rgcottrell / gist:5b876d9c5eea4c9e411c
Created September 21, 2014 17:38
An FM Synthesizer in Swift using AVAudioEngine
import AVFoundation
import Foundation
// The maximum number of audio buffers in flight. Setting to two allows one
// buffer to be played while the next is being written.
private let kInFlightAudioBuffers: Int = 2
// The number of audio samples per buffer. A lower value reduces latency for
// changes but requires more processing but increases the risk of being unable
// to fill the buffers in time. A setting of 1024 represents about 23ms of
@joemasilotti
joemasilotti / About.md
Last active March 26, 2020 09:35
Building NSURL Queries with NSURLQueryItems and NSURLComponents
@dideler
dideler / upgrade-postgres-9.3-to-9.4.md
Last active June 8, 2020 03:24
Upgrading PostgreSQL from 9.3 to 9.4 when upgrading Ubuntu 14.04 to 14.10

TL;DR

Create a backup:

pg_dumpall > mybackup.sql

Perform the upgrade:

sudo pg_dropcluster 9.4 main --stop