Skip to content

Instantly share code, notes, and snippets.

View johndpope-karhoo's full-sized avatar

johndpope-karhoo

  • Karhoo
  • New York
View GitHub Profile
@johndpope-karhoo
johndpope-karhoo / mongo-notes.js
Created October 26, 2016 17:31 — forked from thoragio/mongo-notes.js
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
@johndpope-karhoo
johndpope-karhoo / inspect.py
Created October 18, 2016 14:17 — forked from hayd/inspect.py
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(),
# chmod +x karhoo_setup.sh
#!/bin/bash
#NODE_VERSION=0.4.7
#NPM_VERSION=1.0.94
# Examples
# https://github.com/donnemartin/dev-setup/blob/master/brew.sh
# https://gist.github.com/phatblat/1713458#file-heroku-node-init-sh
# https://gist.github.com/zenorocha/7159780
@johndpope-karhoo
johndpope-karhoo / global_variable_demo.swift
Created October 5, 2016 20:48 — forked from huguesbr/global_variable_demo.swift
Simple global demo of global variable features (computed, willSet, didSet)
import XCTest
import Foundation
var testCases: [AnyClass] = []
class computedTests: XCTestCase {
let formula = 2 * M_PI
func testComputedGet() {
var radius: Double = 1
@johndpope-karhoo
johndpope-karhoo / XCTestCase+Expectation.swift
Created October 5, 2016 20:29 — forked from cgoldsby/XCTestCase+Expectation.swift
XCTestCase extension with boilerplate code for unit testing async functions (waiting for expectations)
//
// AsyncTests.swift
//
import XCTest
// MARK: Async Helper Extension
extension XCTestCase {
@johndpope-karhoo
johndpope-karhoo / Fastfile
Created September 23, 2016 16:21 — forked from dalu93/Fastfile
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'
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)
import Foundation
import SnapKit
let screenWidth = UIScreen.mainScreen().bounds.width
class SnapKitHelperView:UIView{
var debugConstraints = false
@johndpope-karhoo
johndpope-karhoo / simulator_populator
Last active September 13, 2016 01:53 — forked from cabeca/simulator_populator
This script removes and recreates all simulators in Xcode 6.
gem install snapshot; snapshot reset_simulators
killall Xcode
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService
rm -rf ~/Library/Developer/CoreSimulator/Devices
open /Applications/Xcode.app
@johndpope-karhoo
johndpope-karhoo / HARFile.swift
Created September 3, 2016 13:54
HARFile.swift decodable
//
// HARFile.swift
// HarReader
//
// Created by John Pope on 8/26/16.
// Copyright © 2016 John Pope. All rights reserved.
//
import Foundation
import Decodable