Skip to content

Instantly share code, notes, and snippets.

@RLovelett
RLovelett / run.sh
Last active August 29, 2015 14:10
Pool Predictors
#!/usr/bin/env bash
if [ -a /home/ryan/bin/weka/weka-3-7-11/weka.jar ]
then
export CLASSPATH=/home/ryan/bin/weka/weka-3-7-11/weka.jar:/home/ryan/Source/student-filters/StudentFilters.jar:.
else
export CLASSPATH=/Applications/weka-3-7-11/weka.jar:.
fi
if [ "$(uname)" == "Darwin" ]
@RLovelett
RLovelett / README.md
Last active October 17, 2015 02:15 — forked from agnoster/README.md
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@RLovelett
RLovelett / initial-tuning-data.txt
Last active November 22, 2015 19:10
Linux TV zap and MPlayer Configs
#------------------------------------------------------------------------------
# file automatically generated by w_scan
# (http://wirbel.htpc-forum.de/w_scan/index2.html)
#! <w_scan> 20141122 1 0 TERRCABLE_ATSC US </w_scan>
#------------------------------------------------------------------------------
# location and provider: <add description here>
# date (yyyy-mm-dd) : 2015-11-22
# provided by (opt) : <your name or email here>
#
# A[2] <freq> <mod> [# comment]
@RLovelett
RLovelett / AVCodec.swift
Last active December 15, 2015 16:12
Allow `withUnsafePointer` to not mark `struct` function as `mutating`
extension AVCodec {
mutating func profileName(profile: Int32) -> String? {
let result = withUnsafePointer(&self) { (codecPointer) in
return av_get_profile_name(codecPointer, profile)
}
return String.fromCString(result)
}
}

Keybase proof

I hereby claim:

  • I am rlovelett on github.
  • I am rlovelett (https://keybase.io/rlovelett) on keybase.
  • I have a public key ASCSdXfEevoHXXVb5eMvjn8rUL00ucXGH1-a1Czn-JSfJgo

To claim this, I am signing this object:

@RLovelett
RLovelett / README.md
Last active March 18, 2020 22:01
Systemd Unit and Timer to Build Swift Everyday

Swift Toolchain Build

These systemd unit and timer configurations will get an up-to-date copy of Swift and build the toolchain every day at 2:00 AM local time.

Prerequisites

In order for these configurations to work without modification it is assumed that all of the development dependencies are already installed and that the Swift repository is cloned in $HOME/Source/swift-source/swift.

Install

@RLovelett
RLovelett / CMakeLists.txt
Created April 1, 2020 17:59
Example of preferring Python 2 over Python3 with new FindPython2 and FindPython3 CMake modules
cmake_minimum_required(VERSION 3.12.4)
find_package(Python2 COMPONENTS Interpreter)
find_package(Python3 COMPONENTS Interpreter)
if (NOT Python2_Interpreter_FOUND AND NOT Python3_Interpreter_FOUND)
message(FATAL_ERROR "Could NOT find Python2 or Python3")
endif()
# https://github.com/Kitware/CMake/blob/cfc92b483fbd3695d4a67843977e709ba4d7ea47/Modules/FindPython/Support.cmake#L2433-L2439
@RLovelett
RLovelett / mtoc.sh
Created October 29, 2019 20:50
Compile mtoc on macOS Catalina Xcode 11
# https://github.com/macports/macports-ports/blob/master/devel/cctools/Portfile
curl -o cctools-921.tar.gz https://opensource.apple.com/tarballs/cctools/cctools-921.tar.gz
curl -o llvm-8.0.1.src.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/llvm-8.0.1.src.tar.xz
curl -o ld64-409.12.tar.gz https://opensource.apple.com/tarballs/ld64/ld64-409.12.tar.gz
tar xvf cctools-921.tar.gz
tar xvf llvm-8.0.1.src.tar.xz
tar xvf ld64-409.12.tar.gz
@RLovelett
RLovelett / smb.conf
Last active April 8, 2021 15:26
Samba Configuration
# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
load printers = no
@RLovelett
RLovelett / gist:6791bde80575fc412983
Created October 14, 2015 00:50 — forked from chrislavender/gist:cad26500c9655627544f
HTTP Live Streaming Tutorial

Note: This is an older post that I did back when I thought I might have time to be a blogger. Oh I was oh so wrong. However, it has proven useful for some folks on stackoverflow. Thus I'm keeping it alive here on Gist.

One of my past projects dealt heavily with an open source Apple technology called HTTP Live Streaming. It’s an HTTP based streaming protocol that at its most fundamental level provides a way to stream video and audio from just about any server with nothing but a few free software tools provided by Apple**. However, it has a few additional features that I think make it a really exciting tool. Yet, I haven’t seen HTTP Live Streaming used very much. This is probably mainly due to the combination of a lack of good/clear documentation, and Apple’s Live Streaming Developer Tools being command line based also make the barrier to entry higher than many developers want to deal with.

The hope is to share my understanding of how to use this technology to: