Skip to content

Instantly share code, notes, and snippets.

View huguesbr's full-sized avatar

Hugues Bernet-Rollande huguesbr

View GitHub Profile
@huguesbr
huguesbr / XCTestExpectationExtensions.swift
Last active April 8, 2016 09:29
Simple extension on XCTestExpectation to allow to specify an expectation count. see following test for exemple
//
// XCTestExpectationExtensions.swift
//
// Created by Hugues Bernet-Rollande on 7/4/16.
//
import XCTest
extension XCTestExpectation {
private class IntWrapper {
@karolyi
karolyi / osx_keyboardspeed.sh
Created November 19, 2015 20:54
Mac OS X super fast keyboard speed
#!/usr/bin/env bash
# http://papers.ch/speeding-up-your-mac-osx-terminal-input/
#echo "Disable press-and-hold for keys in favor of key repeat"
#defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
echo "Set a blazingly fast keyboard repeat rate"
defaults write NSGlobalDomain KeyRepeat -int 0.02
@huguesbr
huguesbr / iOSSimDeleteAll.sh
Created October 13, 2015 07:27
Delete all iOS Simulator
xcrun simctl list devices | grep -v '^[-=]' | cut -d "(" -f2 | cut -d ")" -f1 | xargs -I {} xcrun simctl delete "{}"
@snown
snown / playgroundUtil
Last active August 5, 2016 08:23
Quick bash script for converting Swift playgrounds between Mac and iOS.
#!/usr/bin/env bash
VERSION=0.1.0
USAGE="$(basename "$0") [--ios|--mac] [-f ./file.playground] [Files...]
where:
-h Show this help text
--ios Tells the command to turn the playground into a iOS compatible playground (default).
--mac Tells the command to turn the playground into a iOS compatible playground.
-f The path to a playground file (or you can leave out and all trailing arguments are parsed for playgrounds).
@iosdevzone
iosdevzone / CommonCryptoHack
Created September 21, 2014 03:14
A shell script to write a dummy CommonCrypto.framework module into the directory where playgrounds look for frameworks.
#!/bin/bash
if [[ $BASH_SOURCE != $0 ]]; then echo "$BASH_SOURCE must be executed, not sourced."; return 255; fi
#
# A script to fool iOS playgrounds into allowing access to CommonCrypto
#
# The script creates a dummy CommonCrypto.framework in the SDK's System
# Framework Library Directory with a module map that points to the
# umbrella header
#
# Usage:
- (void)show:(BOOL)animated {
self.alpha = 0.0f;
self.hidden = NO;
if (animated) {
[UIView beginAnimations:nil context:nil];
}
self.alpha = 1.0f;