Skip to content

Instantly share code, notes, and snippets.



  • Karhoo
  • New York
View GitHub Profile
# chmod +x
# Examples
View mongo-notes.js
// 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)
// restore a DB dump from a binary (BSON) dump file
"""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(),
johndpope-karhoo / global_variable_demo.swift
Created Oct 5, 2016 — forked from huguesbr/global_variable_demo.swift
Simple global demo of global variable features (computed, willSet, didSet)
View global_variable_demo.swift
import XCTest
import Foundation
var testCases: [AnyClass] = []
class computedTests: XCTestCase {
let formula = 2 * M_PI
func testComputedGet() {
var radius: Double = 1
johndpope-karhoo / XCTestCase+Expectation.swift
Created Oct 5, 2016 — forked from cgoldsby/XCTestCase+Expectation.swift
XCTestCase extension with boilerplate code for unit testing async functions (waiting for expectations)
View XCTestCase+Expectation.swift
// AsyncTests.swift
import XCTest
// MARK: Async Helper Extension
extension XCTestCase {
johndpope-karhoo / Fastfile
Created Sep 23, 2016 — forked from dalu93/Fastfile
Fastfile example
View Fastfile
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'
View SnapkitExampleContainer.swift
import Foundation
import SnapKit
class SnapkitExampleContainer:SnapKitHelperView{
// TODO - remove xcode constraints and
private lazy var supplierImageContainer: UIView = self.viewByTag(500)
private lazy var statusLabel: UILabel = self.labelByTag(501)
private lazy var detailsViewSnapkitContainer: UIView = self.viewByTag(502)
View SnapKitHelperView.swift
import Foundation
import SnapKit
let screenWidth = UIScreen.mainScreen().bounds.width
class SnapKitHelperView:UIView{
var debugConstraints = false
johndpope-karhoo / simulator_populator
Last active Sep 13, 2016 — forked from cabeca/simulator_populator
This script removes and recreates all simulators in Xcode 6.
View simulator_populator
gem install snapshot; snapshot reset_simulators
killall Xcode
sudo killall -9
rm -rf ~/Library/Developer/CoreSimulator/Devices
open /Applications/
johndpope-karhoo / HARFile.swift
Created Sep 3, 2016
HARFile.swift decodable
View HARFile.swift
// HARFile.swift
// HarReader
// Created by John Pope on 8/26/16.
// Copyright © 2016 John Pope. All rights reserved.
import Foundation
import Decodable