This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asm volatile(R"( | |
# r1 = 0 | |
mov r1, #0 | |
# r1 += 5 | |
add r1, r1, #5 | |
# r1 -= 1 | |
sub r1, r1, #1 | |
)"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
// Mark: custom enum | |
enum Toast: Int { | |
case raw = 1 | |
case black | |
} | |
if let toast = Toast.init(rawValue: 999) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tested for capistrano 3.6.1 | |
Rake::Task["deploy:check"].clear_actions | |
namespace :deploy do | |
task check: :'git:wrapper' do | |
on release_roles :all do | |
execute :mkdir, "-p", "#{fetch(:tmp_dir)}/#{fetch(:application)}/" | |
upload! StringIO.new("#!/bin/sh -e\nexec /usr/bin/env ssh -o PasswordAuthentication=no -o StrictHostKeyChecking=no \"$@\"\n"),fetch(:git_wrapper_path) | |
execute :chmod, "+x", fetch(:git_wrapper_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
/** | |
generic protocol that is Equatable by itself | |
and wraps any equatable data type | |
*/ | |
protocol SameOldThingable: Equatable { | |
associatedtype DataType: Equatable | |
var data: DataType { get set } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct Book { | |
public private(set) var page: Int | |
public mutating func browseTo(page requestedPage: Int) { | |
page = requestedPage | |
/// show requested page | |
/// do other things that have to be done when | |
/// changing the current page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum MonitorType { | |
case widescreen(size: Int, refreshRate: Int, manufacturer: String) | |
case ultrawidescreen(size: Int, refreshRate: Int, manufacturer: String) | |
} | |
let widescreenMonitor: MonitorType = .widescreen(size: 26, refreshRate: 6, manufacturer: "Apple") | |
let ultraWidescreenMonitor: MonitorType = .ultrawidescreen(size: 28, refreshRate: 6, manufacturer: "Eizo") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xcodebuild -workspace MyApp.xcworkspace -scheme MyApp clean build \ | |
OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-function-bodies" > compiletimes.debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see https://gist.github.com/muhasturk/df28ec9d2cc18bf1cfc8 | |
# see https://github.com/github/gitignore/blob/master/Swift.gitignore | |
*.xcodeproj/* | |
!*.xcodeproj/project.pbxproj | |
!*.xcodeproj/xcshareddata | |
# | |
# *.lock - this is used and abused by many editors for many different things. | |
# For the main ones I use (e.g. Eclipse), it should be excluded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Project specific | |
# ... | |
# Project Dev | |
logs/* | |
build/* | |
!build/.gitkeep | |
!logs/.gitkeep | |
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM java:7 | |
MAINTAINER Steve Rohrlack | |
# docker run -v $HOME/example-project/sitespeedio-logs/:/usr/local/src/example-project/sitespeedio-logs/ default | |
# sitespeed.io will write log files and reports to a defined directory | |
# configure environment | |
ENV DEBIAN_FRONTEND noninteractive |