Skip to content

Instantly share code, notes, and snippets.

View johndpope-karhoo's full-sized avatar

johndpope-karhoo

  • Karhoo
  • New York
View GitHub Profile
@kristopherjohnson
kristopherjohnson / KDJKeychainItemWrapper.h
Created March 21, 2013 12:18
My version of the KeychainItemWrapper class from Apple's GenericKeychain sample, converted to ARC and modernized
// Based upon code from Apple's "GenericKeychain" sample application
/*
File: KeychainItemWrapper.h
Abstract:
Objective-C wrapper for accessing a single keychain item.
Version: 1.2
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
@dalu93
dalu93 / Fastfile
Last active October 1, 2021 15:22
Fastfile example
fastlane_version "1.49.0"
default_platform :ios
######################
slack_webhook = 'https://...' #See Slack Incoming Webhook
slack_default_channel = '#channel'
default_production_scheme = 'YOUR-PRODUCTION-SCHEME'
certificates_output_path = './certificates'
profiles_output_path = './profiles'
@thoragio
thoragio / mongo-notes.js
Last active March 12, 2021 07:57
Mongo Notes
// MONGO COMMAND LINE
// start mongod
ulimit -n 2048 && mongod
// ctrl-c ends in same window, but can also use
killall mongod
// start mongod with data directory in another location
mongod -dbpath /path/to/data/dir
// open command line interface (mongo shell)
mongo
// restore a DB dump from a binary (BSON) dump file
@nicolas-miari
nicolas-miari / NSError+Shorthand.swift
Last active May 22, 2017 07:53
Swift extension that provides convenient shorthands for initializing `NSError` objects.
/**
Provides convenient shorthands for initializing `NSError` objects.
*/
extension NSError {
/**
Same as `init(domain:code:userInfo:)`, but `domain` defaults to the app's
bundle indentifier.
*/
convenience init(code: Int, userInfo: [NSObject : AnyObject]?) {
let bundleIdentifier = NSBundle.mainBundle().bundleIdentifier!
@hayd
hayd / inspect.py
Created March 27, 2015 23:10
inspect.py
"""Get useful information from live Python objects.
This module encapsulates the interface provided by the internal special
attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.
Here are some of the useful functions provided by this module:
ismodule(), isclass(), ismethod(), isfunction(), isgeneratorfunction(),
isgenerator(), istraceback(), isframe(), iscode(), isbuiltin(),
@orj
orj / NSErrorUserInfoValueProviding.swift
Last active October 5, 2016 15:54
A protocol that can be adopted by ErrorType, RawRepresentable conforming types that provides a mechanism for providing NSError userInfo values.
/// A protocol that can be adopted by ErrorType, RawRepresentable conforming types that
/// provides a mechanism for providing NSError userInfo values.
///
/// There are nil returning default implementations of all of the members of this protocol.
protocol NSErrorUserInfoValueProviding {
var localizedDescription: String? { get }
var localizedFailureReason: String? { get }
var localizedRecoverySuggestion: String? { get }
var localizedRecoveryOptions: [String]? { get }
@m4c1ek
m4c1ek / gist:7bfc388a8144ddbeaf5d
Last active September 16, 2016 20:28
AutoLayout

NSLog(@"%@", [[[UIApplication sharedApplication] keyWindow] performSelector:@selector(_autolayoutTrace)]);
po [[UIWindow keyWindow] _autolayoutTrace];

Cocoa layout example

UIViewShowAlignmentRects YES
UIViewShowAlignmentRects

@Ashton-W
Ashton-W / .lldbinit
Created April 19, 2016 04:27
LLDB sim_location command (lldbinit)
command alias sim_location expr (void)NSLog(@"Printing Simulator App Paths:\n\nBundle:\n%@\n\nDocuments:\n%@\n\n", [[NSBundle mainBundle] resourcePath], [[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject] resourceSpecifier]);
/*
ericasadun.com
Super-basic layout utilities
*/
#if os(OSX)
import Cocoa
public typealias View = NSView
@danthegoodman
danthegoodman / alert.sh
Last active September 2, 2016 21:47
iTerm niceties for bash
# Sends a message to growl from the terminal
#
# Usage: alert <text>
# Result: Growl notification with text
#
# Example: sleep 10 ; alert 'I am awake'
alert() { echo -e $'\e]9;'${@}'\007' ; }