Skip to content

Instantly share code, notes, and snippets.

View neonichu's full-sized avatar
🤬
GitHub, cancel your contract with ICE!

Boris Bügling neonichu

🤬
GitHub, cancel your contract with ICE!
View GitHub Profile
@neonichu
neonichu / swift-versions.sh
Created February 2, 2016 21:23
Figure out which commits correspond to which Swift version, maybe
#!/bin/sh
git log -p CMakeLists.txt|grep -B 25 '^+set(SWIFT_VERSION'|grep ^commit
@neonichu
neonichu / update-travis.sh
Created December 16, 2015 16:37
Update used Xcode image for Travis automatically
#!/bin/sh
function available_versions() {
curl -s 'https://docs.travis-ci.com/user/languages/objective-c/'| \
grep 'osx_image: '|sed -e 's_.*<code>\(osx\_image.*\)</code>.*_\1_'|sort|uniq
}
function latest_version {
available_versions|tail -n 1
}
@neonichu
neonichu / enzo.sh
Last active December 11, 2015 20:39
Parse an API blueprint hosted on Apiary via the API Blueprint API
#!/bin/sh
#BLUEPRINT=contentfulcda
#BLUEPRINT=contentfulcma
BLUEPRINT=$1
if [ -z "$BLUEPRINT" ]; then
echo "Usage: $0 blueprint-file" >&2
exit 1
fi
@neonichu
neonichu / serve.swift
Last active April 21, 2022 17:09
Tiny HTTP server example in Swift.
#!/usr/bin/env swift
#if os(Linux)
import Glibc
let sin_zero = (UInt8(0),UInt8(0),UInt8(0),UInt8(0),UInt8(0),UInt8(0),UInt8(0),UInt8(0))
let sock_stream = Int32(SOCK_STREAM.rawValue)
#else
import Darwin.C
@neonichu
neonichu / yolo.swift
Created November 30, 2015 23:02
Slowly approaching significant Swift hipster status
func signalify<T, U, V>(p: T, _ c: (T, (Result<U>) -> ()) -> V) -> (V, Signal<U>) {
let s = Signal<U>()
let v = c(p) { s.update($0) }
return (v, s)
}
@neonichu
neonichu / hide-schemes.rb
Created November 16, 2015 14:48
Automatically hide all schemes from the Pods project for the current user
#!/usr/bin/env ruby
require 'CFPropertyList'
user = ENV['USER']
path = "Pods/Pods.xcodeproj/xcuserdata/#{user}.xcuserdatad/xcschemes/xcschememanagement.plist"
plist = CFPropertyList::List.new(:file => path)
userState = plist.value.value['SchemeUserState'].value
@neonichu
neonichu / code-signing.md
Last active April 16, 2023 02:34
A few ways of checking code signatures on OS X.

Code Signing

A few ways of checking code signatures on OS X.

Simple

$ /usr/bin/codesign --verify --deep --verbose /Applications/Xcode.app
/Applications/Xcode.app: valid on disk
/Applications/Xcode.app: satisfies its Designated Requirement
@neonichu
neonichu / yolo.txt
Created August 25, 2015 09:59
CLI output when running `Xcode -installComponents` with Xcode 7.0 beta 6
2015-08-25 11:56:10.088 Xcode[19168:1241367] ### Failed to load Addressbook class CNContactNameFormatter
2015-08-25 11:56:10.862 Xcode[19168:1241367] NSWindow warning: adding an unknown subview: <NSView: 0x7faae2ceac30>. Break on NSLog to debug.
2015-08-25 11:56:10.896 Xcode[19168:1241367] Call stack:
(
0 AppKit 0x00007fff9b85256b -[NSThemeFrame addSubview:] + 107
1 AppKit 0x00007fff9b880fa8 -[NSView replaceSubview:with:] + 153
2 IDEKit 0x0000000102aac6be -[IDEFirstLaunchExperienceViewController _replaceView:withView:] + 176
3 IDEKit 0x0000000102aab235 -[IDEFirstLaunchExperienceViewController showFirstLaunchExperienceModallyIfNecessary] + 181
4 IDEKit 0x00000001024ded07 -[IDEWelcomeWindowController _showFirstLaunchExperienceIfAppropriate] + 196
5 IDEKit 0x00000001025f21d0 -[IDEWelcomeWindowController showFirstLaunchExper
@neonichu
neonichu / broken-cp-versions.txt
Created July 25, 2015 00:31
Version numbers in the CocoaPods Spec repo which break clang's `-current_version` option
0.0.1-alpha
0.0.1.beta.1
0.0.1.beta.2
0.0.1.beta.3
0.0.1.beta.4
0.0.1.beta.5
0.0.1.pre.1
0.0.1b1
0.0.4-pre
0.0.4.b3
@neonichu
neonichu / check.rb
Created July 20, 2015 08:43
Check for CocoaPods version
#!/usr/bin/env ruby
require 'cocoapods'
require 'rubygems/version'
version = Gem::Version.new(Pod::VERSION)
p version >= Gem::Version.new('0.37.99')