Skip to content

Instantly share code, notes, and snippets.

View traviskirton's full-sized avatar

Travis traviskirton

View GitHub Profile
.flow-layer {
position: absolute;
overflow: visible;
box-sizing: border-box;
border-width: 0px;
}
.flow-bg {
width: 100%;
/**
* Class representing the FlowSoloTimeline timeline.
*
* Made with Flow
*/
class FlowSoloTimeline {
/**
* @constructor
*
@traviskirton
traviskirton / sendTasks.scpt
Last active April 24, 2017 17:58
OmniFocus send tasks script
# Copyright 2017 Travis Kirton
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE US
@traviskirton
traviskirton / Image+ColorAt.swift
Created November 30, 2016 19:04
Adds extensions to Image and Color that allow user to grab a color at a specified pixel in an image
public extension Image {
public func color(at point: Point) -> Color {
let bitmapInfo = CGBitmapInfo(rawValue: CGImageAlphaInfo.premultipliedFirst.rawValue)
guard let offscreenContext = CGContext(data: nil, width: 1, height: 1, bitsPerComponent: 8, bytesPerRow: 0, space: CGColorSpaceCreateDeviceRGB(), bitmapInfo: bitmapInfo.rawValue) else {
print("Could not create offscreenContext")
return clear
}
offscreenContext.translateBy(x: CGFloat(-point.x), y: CGFloat(-point.y))
@traviskirton
traviskirton / WorkSpace.swift
Created August 29, 2016 08:42
Bees + Bombs Mask
//
// WorkSpace.swift
// BeesBombs
//
// Created by travis on 2016-08-27.
// Copyright © 2016 C4. All rights reserved.
//
import UIKit
@traviskirton
traviskirton / WorkSpace.swift
Last active August 29, 2016 03:51
Bees + Bombs
class WorkSpace: CanvasController {
var circles = [Circle]()
var wedges = [Wedge]()
override func setup() {
let d = 160.0 //radius of circle
canvas.backgroundColor = white
let container = View(frame: Rect(0,0,d,d))
container.center = canvas.center
@traviskirton
traviskirton / C4.dvtcolortheme
Created June 8, 2016 22:12
C4 Xcode Color Theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0 0 0 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0 0 0 1</string>
@traviskirton
traviskirton / WorkSpace.swift
Created May 30, 2016 21:52
Radial Audio Tutorial
class WorkSpace: CanvasController {
var player: AudioPlayer!
var timer: Timer?
//create tuples for storing paths
var maxPaths = (Path(), Path())
var avgPaths = (Path(), Path())
//create tuples for storing shapes to represent the paths
var maxShapes = (Shape(), Shape())
var avgShapes = (Shape(), Shape())
@traviskirton
traviskirton / WorkSpace.swift
Created May 30, 2016 21:05
Grab the max and avg values of an audio sample
class WorkSpace: CanvasController {
var max0 = 0.0
var max1 = 0.0
var avg0 = 0.0
var avg1 = 0.0
var player = AudioPlayer("BlackVelvet.m4a")!
var timer: Timer?
@traviskirton
traviskirton / MathComparePaths.swift
Created May 17, 2016 03:38
Code needed to run basic math examples on www.c4ios.com
// Copyright © 2016 C4
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions: The above copyright
// notice and this permission notice shall be included in all copies or
// substantial portions of the Software.