Skip to content

Instantly share code, notes, and snippets.

View tsraveling's full-sized avatar

Tim Raveling tsraveling

View GitHub Profile
@tsraveling
tsraveling / implementation.md
Last active July 25, 2017 15:46
Slideout Menu

1. Add pod:

pod 'SWRevealViewController', '~> 2.3'

2. Set up storyboard:

  • Set up a SWRevealViewController as the parent VC
  • Custom reveal set segue to menu with id sw_rear
  • Custom reveal set segue to main view with id sw_front
@tsraveling
tsraveling / todo.sh
Created July 20, 2017 15:45
TODO Xcode Run Script
TAGS="TODO:|FIXME:"
echo "searching ${SRCROOT} for ${TAGS}"
find "${SRCROOT}" \( -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/"
@tsraveling
tsraveling / matches-username-at-end.txt
Last active July 14, 2017 19:21
Regex pattern check
@.*[a-zA-z0-9_]$
static var audioPlayer : AVPlayer?
@tsraveling
tsraveling / AppDelegate.swift
Created May 11, 2017 18:25
Play sound through speakers
// Play sound through speakers
do {
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord)
} catch _ {
}
do {
try AVAudioSession.sharedInstance().setActive(true)
} catch _ {
}
do {
@tsraveling
tsraveling / CIFilterType.swift
Created May 9, 2017 17:35
Core Image Filter Types
enum CIFilterType : String {
case BoxBlur = "CIBoxBlur"
case DiscBlur = "CIDiscBlur"
case GaussianBlur = "CIGaussianBlur"
case MaskedVariableBlur = "CIMaskedVariableBlur"
case MedianFilter = "CIMedianFilter"
case MotionBlur = "CIMotionBlur"
case NoiseReduction = "CINoiseReduction"
case ZoomBlur = "CIZoomBlur"
case ColorClamp = "CIColorClamp"
@tsraveling
tsraveling / Procfile
Created May 7, 2017 14:58
Python Twitter Bot
worker: python3 tweetbot.py
@tsraveling
tsraveling / Array+Params.swift
Created April 25, 2017 23:18
Extend Params Dictionary
extension Dictionary where Key: ExpressibleByStringLiteral, Value:Any {
}
@tsraveling
tsraveling / table-header-text.swift
Created April 25, 2017 17:31
Set UITableView header text color
func tableView(_ tableView: UITableView, willDisplayHeaderView view:UIView, forSection: Int) {
if let headerView = view as? UITableViewHeaderFooterView {
headerView.textLabel?.textColor = .white
}
}
@tsraveling
tsraveling / protocol.md
Last active April 26, 2017 18:34
Twitter Integration

Twitter sharing

1. Install TwitterKit

Use Fabric. Make sure to reference the right app in info.plist -> Fabric -> Kits.

2. In VC:

Import: