Skip to content

Instantly share code, notes, and snippets.

-- C4 -- C4Framework

Block or report user

Report or block C4Framework

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@C4Framework
C4Framework / sendTasks.scpt
Last active Apr 24, 2017
OmniFocus send tasks script
View sendTasks.scpt
# 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
@C4Framework
C4Framework / Image+ColorAt.swift
Created Nov 30, 2016
Adds extensions to Image and Color that allow user to grab a color at a specified pixel in an image
View Image+ColorAt.swift
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))
View WorkSpace.swift
//
// WorkSpace.swift
// BeesBombs
//
// Created by travis on 2016-08-27.
// Copyright © 2016 C4. All rights reserved.
//
import UIKit
View WorkSpace.swift
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
View C4.dvtcolortheme
<?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>
@C4Framework
C4Framework / WorkSpace.swift
Created May 30, 2016
Radial Audio Tutorial
View WorkSpace.swift
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())
@C4Framework
C4Framework / WorkSpace.swift
Created May 30, 2016
Grab the max and avg values of an audio sample
View WorkSpace.swift
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?
@C4Framework
C4Framework / MathComparePaths.swift
Created May 17, 2016
Code needed to run basic math examples on www.c4ios.com
View MathComparePaths.swift
// 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.
@C4Framework
C4Framework / WorkSpace.swift
Created May 5, 2016
Simple demo of ScreenRecorder... Creates animated points when the user quickly flicks the screen.
View WorkSpace.swift
// import C4
import UIKit
class WorkSpace: CanvasController {
var screenRecorder: ScreenRecorder?
override func setup() {
self.screenRecorder = ScreenRecorder()
self.screenRecorder?.recordingEndedAction = {
self.screenRecorder?.showPreviewInController(self)
}
@C4Framework
C4Framework / WorkSpace.swift
Last active Jun 13, 2018
Drawing Shapes to a PDF
View WorkSpace.swift
// Copyright © 2014 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.
You can’t perform that action at this time.