Skip to content

Instantly share code, notes, and snippets.

View chrispix's full-sized avatar

Christopher Pickslay chrispix

View GitHub Profile
@chrispix
chrispix / sim.zsh
Created January 4, 2023 02:58 — forked from justin/sim.zsh
Convenience wrapper around the simctl command to perform operations related to iOS simulators.
#!/usr/bin/env zsh
#
# Convenience wrapper around the simctl command to perform operations related to iOS simulators.
# Author: Justin Williams (@justin)
#
# Usage: sim <options> <subcommand>
#
# This script is designed to work with ZSH. ymmv with other shells.
set -e
@chrispix
chrispix / adjustEmojiFont.swift
Created May 12, 2016 17:02
Adjust font size for emoji
// doesn't work, as there's a bug with displaying some emoji in a smaller font on the same line
class func adjustEmojiFont(emojiFont: UIFont, regularFont: UIFont, forText text: String) -> NSMutableAttributedString {
let emojiCharacterSet = NSCharacterSet.emojiCharacterSet
let scanner = NSScanner(string: text)
let attributed = NSMutableAttributedString()
var words: NSString? = nil
var emoji: NSString? = nil
// in case the string starts with emoji
@chrispix
chrispix / centering.m
Created August 8, 2011 23:48
Centering a view in its superview
image.frame.origin.y =
(container.frame.size.height - image.frame.size.height)/2
#!/bin/bash -e
# More information at http://0xced.blogspot.com/2010/07/using-sdk-313-with-iphone-sdk-4.html
IPHONE_SDK_DMG="$HOME/Downloads/iphone_sdk_3.1.3_with_xcode_3.2.1__snow_leopard__10m2003a.dmg"
DEVELOPER_DIR="/Developer"
MOUNT_POINT="/Volumes/iPhone SDK"
function cleanup
{
echo ""