Skip to content

Instantly share code, notes, and snippets.

View honood's full-sized avatar
👋

HoNooD honood

👋
View GitHub Profile
@honood
honood / remove-python27-osx-via-pythonorg-installer-dmg.md
Created April 20, 2019 13:33 — forked from sr75/remove-python27-osx-via-pythonorg-installer-dmg.md
remove python 2.7 on mac osx if installed via python.org installer .dmg
# sudo rm -rf /Library/Frameworks/Python.framework
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
sudo rm -rf "/Applications/Python 2.7"
cd /usr/local/bin && \
sudo ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | xargs rm
@honood
honood / UIAlertController+TextField.swift
Created August 17, 2018 10:43 — forked from ole/UIAlertController+TextField.swift
A UIAlertController with a text field and the ability to perform validation on the text the user has entered while the alert is on screen. The OK button is only enabled when the entered text passes validation. More info: https://oleb.net/2018/uialertcontroller-textfield/
import UIKit
/// A validation rule for text input.
public enum TextValidationRule {
/// Any input is valid, including an empty string.
case noRestriction
/// The input must not be empty.
case nonEmpty
/// The enitre input must match a regular expression. A matching substring is not enough.
case regularExpression(NSRegularExpression)
@honood
honood / StringsTest.swift
Last active March 10, 2018 10:09 — forked from nicklockwood/StringsTest.swift
string concat benchmarks
import XCTest
// Tweet link: https://twitter.com/nicklockwood/status/972215130825154561
let count = 50000
class StringsTestTests: XCTestCase {
// Tweet link: https://twitter.com/cocoaphony/status/972227239914942474
func testNoMutate() {
@honood
honood / thread_return.py
Created February 13, 2018 03:11
lldb python script that provides a function to… Prints the return value of the last function you stepped out from. This is very useful if the return was a complex expression. This lldb command prevents you from needing to create a temporary variable just to inspect the return value''' (If anyone knows a way of doing this without using needing to…
#/usr/bin/env python
import lldb
# Put _this_ file into ~/Library/lldb/thread_return.py
# Put the following line into ~/.lldbinit
# command script import ~/Library/lldb/thread_return.py
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('command script add -f thread_return.thread_return thread_return')
@honood
honood / symbolizing_osx_crash_logs.md
Created September 25, 2017 11:05 — forked from bmatcuk/symbolizing_osx_crash_logs.md
How to symbolize OSX crash logs

How to Symbolize OSX Crash Logs

Unfortunately, xcode does not yet have support for importing OSX crash logs and symbolizing them. Therefore, you must use the command line and a little bit of manual work.

  1. Find your dSYM file.
    1. Assuming you are using xcode's archive functionality, open the Organizer window from the Window menu.
    2. Click the Archives tab.
    3. Right click on the appropriate build and select Show in Finder.
    4. When Finder opens, right click on the selected archive and select Show Package Contents.
    5. Navigate to the dSYM directory and copy the appropriate dSYM file to a temporary directory.
  2. Then navigate to Products, then Applications, and copy the app file to the same temporary directory.
@honood
honood / FRP iOS Learning resources.md
Created November 20, 2016 15:21 — forked from JaviLorbada/FRP iOS Learning resources.md
The best FRP iOS resources.

Videos

@honood
honood / introrx.md
Created May 14, 2016 10:37 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@honood
honood / StringSize.swift
Last active September 20, 2015 08:41 — forked from plumhead/StringSize.swift
String extension to find the layout size of a String with specified attributes.
extension String {
func size(withAttributes attrs: [String:AnyObject], constrainedTo box: NSSize) -> NSRect {
let storage = NSTextStorage(string: self)
let container = NSTextContainer(containerSize: NSSize(width: box.width, height: box.height))
let layout = NSLayoutManager()
layout.addTextContainer(container)
storage.addLayoutManager(layout)
storage.addAttributes(attrs, range: NSMakeRange(0, storage.length))
container.lineFragmentPadding = 0.0
let _ = layout.glyphRangeForTextContainer(container)
This file has been truncated, but you can view the full file.
__SSTOKENSTRING = "@generated SignedSource<<dbe928e1275c495c1922c1bf063ffb70>>";
! function(e) {
function t(e) {
function t() {
var t = Array.prototype.map.call(arguments, function(e) {
if (null == e) return null === e ? "null" : "undefined";
if ("string" == typeof e) return '"' + e + '"';
try {
return JSON.stringify(e)
} catch (t) {
@honood
honood / HD.txt
Created June 17, 2013 13:57 — forked from lexrus/HD.txt
http://devstreaming.apple.com/videos/wwdc/2013/710xfx3xn8197k4i9s2rvyb/710/710-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/202xdx2x47ezp1wein/202/202-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/200xdx2x35e1pxiinm/200/200-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/413xdx5x97itb5ek4yex3r7/413/413-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/612xax4xx65z1ervy5np1qb/612/612-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/221xex4xxohbllf4hblyngt/221/221-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/220xbx4xipaxfd1tggxuoib/220/220-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/711xcx4x8yuutk8sady6t9f/711/711-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/404xbx2xvp1eaaqonr8zokm/404/404-HD.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2013/505xbx4xrgmhwby4oiwkrpp/505/505-HD.mov?dl=1