Skip to content

Instantly share code, notes, and snippets.

View colemancda's full-sized avatar
🏎️
Working with Swift on ARM

Alsey Coleman Miller colemancda

🏎️
Working with Swift on ARM
View GitHub Profile
@colemancda
colemancda / module.modulemap
Created July 13, 2016 06:01
CStatfs for ARM
module CStatfs [system] {
header "/usr/include/arm-linux-gnueabihf/sys/vfs.h"
export *
}
@colemancda
colemancda / OpenWRT.Armbian.OPZ
Created April 11, 2017 19:43 — forked from darkcurrent/OpenWRT.Armbian.OPZ
OpenWRT on Orange Pi Zero using Armbian uBoot and Kernel
Guide:
1. Install Armbian_5.24.161216_Orangepizero_Ubuntu_xenial_3.4.113.img onto a uSD card using Win32DiskImager or Ubuntu Disk Image Writer
2. (Optional) Mount the uSD in Ubuntu Laptop and expand the partition using GParted.
3. Delete everything from uSD except /boot, /lib/modules and /lib/firmware.
4. Mount openwrt-15.05.1-sunxi-root.ext4 on Ubuntu using loopback interface on /mnt/openwrt
@colemancda
colemancda / linphone-phone-compile-error.txt
Created June 30, 2017 16:59
linphone-phone compile error
Last login: Fri Jun 30 11:27:52 on ttys002
Colemans-MacBook-Pro-Retina:~ coleman$ export PATH=/usr/local/bin:$PATH
Colemans-MacBook-Pro-Retina:~ coleman$ cd /Users/coleman/Developer/linphone-iphone
Colemans-MacBook-Pro-Retina:linphone-iphone coleman$ ./prepare.py -c && ./prepare.py && make
cmake /Users/coleman/Developer/linphone-iphone/submodules/cmake-builder -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/Users/coleman/Developer/linphone-iphone/liblinphone-sdk/x86_64-apple-darwin.ios -DCMAKE_INSTALL_PREFIX=/Users/coleman/Developer/linphone-iphone/liblinphone-sdk/x86_64-apple-darwin.ios -DCMAKE_NO_SYSTEM_FROM_IMPORTED=YES -DLINPHONE_BUILDER_WORK_DIR=/Users/coleman/Developer/linphone-iphone/WORK/ios-x86_64 -DCMAKE_TOOLCHAIN_FILE=toolchains/toolchain-ios-x86_64.cmake -DCMAKE_INSTALL_MESSAGE=LAZY -DLINPHONE_BUILDER_CONFIG_FILE=configs/config-ios-x86_64.cmake -DLINPHONE_BUILDER_EXTERNAL_SOURCE_PATH=/Users/coleman/Developer/linphone-iphone/submodules -DLINPHONE_IOS_DEPLOYMENT_TARGET=8.0 "-DLINPHONE_BUILDER_DUMM
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
@colemancda
colemancda / VLCKit.json
Created October 5, 2017 03:09
Compiled VLCKit Carthage binary dependency
{
"3.0.1": "https://github.com/colemancda/VLCKit/releases/download/v3.0.1/VLCKit.framework.zip"
}
@colemancda
colemancda / gist:7d39b640cca32849e0d33c17f8761270
Created November 19, 2017 16:21
[UITableViewCellLayoutManager layoutSubviewsOfCell:] BT
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 10.1
frame #0: 0x0000000104b0c4a3 UIKit`-[UITableViewCellLayoutManager layoutSubviewsOfCell:]
* frame #1: 0x00000001049bd426 UIKit`-[UITableViewCell layoutSubviews] + 162
frame #2: 0x00000001046546f5 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1439
frame #3: 0x000000010b96a3ee QuartzCore`-[CALayer layoutSublayers] + 153
frame #4: 0x000000010b96e4dd QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 401
frame #5: 0x000000010463e735 UIKit`-[UIView(Hierarchy) layoutBelowIfNeeded] + 662
frame #6: 0x00000001046458f0 UIKit`+[UIView(Animation) performWithoutAnimation:] + 90
frame #7: 0x00000001046e30a3 UIKit`-[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1384
frame #8: 0x00000001046e33eb UIKit`-[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 74
class ArrayImpl<T> {
var space: Int
var count: Int
var ptr: UnsafeMutablePointer<T>
init(count: Int = 0, ptr: UnsafeMutablePointer<T> = nil) {
self.count = count
self.space = count
@colemancda
colemancda / xcompiler_with_spm_raspbian_302.md
Created March 9, 2018 03:13 — forked from uraimo/xcompiler_with_spm_raspbian_302.md
Building a cross-compiling toolchain for Swift 3.0.2 on Raspbian with working SPM

To build a Raspbian toolchain for Swift 3.0.2 a few things need to be changed in the original guide.

Download the Swift 3.0.2 packages instead of the 3.1.1 ones:

curl -o /tmp/swift-3.0.2-RPi1Zero-RaspbianNov16.tgz  https://www.dropbox.com/s/dkrkt9ht1c3hog2/swift-3.0.2-RPi1Zero-RaspbianNov16.tgz
curl -o /tmp/swift-3.0.2-RELEASE-osx.pkg https://swift.org/builds/swift-3.0.2-release/xcode/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-osx.pkg

Launch the script with these parameters:

@colemancda
colemancda / clone-all-twitter-github-repos.sh
Created March 10, 2018 21:16 — forked from caniszczyk/clone-all-twitter-github-repos.sh
Clone all repos from a GitHub organization
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@colemancda
colemancda / Playground.swift
Created April 19, 2019 04:32
Print all CocoaError messages
import Foundation
var errors = [CocoaError: String]()
for code in 0 ... 4866 {
let error = CocoaError(CocoaError.Code(rawValue: code))
if let reason = error._nsError.localizedFailureReason {
errors[error] = reason
}