I hereby claim:
- I am genedelisa on github.
- I am genedelisa (https://keybase.io/genedelisa) on keybase.
- I have a public key ASAHwfTYYwBrMBqbQnBjbRfExg-lU_I-m87yjiYjzKyfdwo
To claim this, I am signing this object:
# Simple Makefile for command line Swift projects | |
# Gene De Lisa | |
PROG = example | |
SRC = src/*.swift | |
INSTALL_DIR = ./bin | |
SWIFTC=xcrun --sdk macosx swiftc | |
# this is a hack right now just to compile |
#!/usr/bin/env zsh | |
# -*- mode: shell-script -*- | |
# | |
# Time-stamp: "Last Modified 2020-05-22 14:43:23 by Gene De Lisa, genedelisa" | |
# | |
# File: ~/dotfiles/.zsh/scripts/ | |
# Gene De Lisa | |
# [email protected] | |
# http://rockhoppertech.com/blog/ |
I hereby claim:
To claim this, I am signing this object:
{ | |
// https://code.visualstudio.com/docs/editor/tasks | |
// See https://go.microsoft.com/fwlink/?LinkId=733558 | |
// for the documentation about the tasks.json format | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
// build and run the current cpp file you're editing. | |
"label": "Build with Clang C++17", |
if let nav = navigationController { | |
nav.setToolbarHidden(false, animated: false) | |
// doesn't really set the button's tint | |
UIToolbar.appearance().tintColor = UIColor.black | |
// instead of setting the text color of each bar button | |
UIBarButtonItem.appearance().tintColor = UIColor.black | |
if let nav = navigationController { | |
nav.setToolbarHidden(false, animated: false) | |
// doesn't really set the button's tint | |
UIToolbar.appearance().tintColor = UIColor.black | |
// instead of setting the text color of each bar button | |
UIBarButtonItem.appearance().tintColor = UIColor.black | |
// the frame size doesn't matter; autolayout will change it | |
var aButton = UIButton(frame: CGRect(x: 0, y: 0, width: 200, height: 200)) | |
aButton.titleLabel?.text = "HEY" | |
aButton.opaque = true | |
aButton.backgroundColor = UIColor.yellow | |
view.addSubview(aButton) | |
aButton.translatesAutoresizingMaskIntoConstraints = false | |
let margins = view.layoutMarginsGuide |
/** | |
Scroll to make the the given section header visible. | |
The function scrollToItemAtIndexPath will scroll to the item and hide the section header. | |
Swift 3. | |
*/ | |
func scrollToSection(_ section:Int) { | |
if let cv = self.collectionView { | |
let indexPath = IndexPath(item: 1, section: section) | |
if let attributes = cv.layoutAttributesForSupplementaryElement(ofKind: UICollectionElementKindSectionHeader, at: indexPath) { | |
public class Foo : StringLiteralConvertible { | |
var num:Int = 0 | |
required public init(stringLiteral value: StringLiteralType) { | |
self.num = value.toInt()! | |
// of course you can do something more complicated by parsing the value. | |
} | |
public typealias UnicodeScalarLiteralType = StringLiteralType |
func loopTrack(musicTrack:MusicTrack) { | |
var trackLength = getTrackLength(musicTrack) | |
println("track length is \(trackLength)") | |
setTrackLoopDuration(musicTrack, duration: trackLength) | |
} | |
func getTrackLength(musicTrack:MusicTrack) -> MusicTimeStamp { | |
//The time of the last music event in a music track, plus time required for note fade-outs and so on. |