Skip to content

Instantly share code, notes, and snippets.

@kvnsmth
kvnsmth / roam-export-jq-examples.sh
Last active June 4, 2020 08:04
JQ recipes to use with Roam Export JSON
##########################################################################
## List Page Titles
##########################################################################
# list in same order as export
jq ".[].title" export.json
# sort by title
jq "sort_by(.title) | .[].title" export.json
@kvnsmth
kvnsmth / cloudSettings
Last active July 30, 2020 01:29
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-07-30T01:28:59.299Z","extensionVersion":"v3.4.3"}
@kvnsmth
kvnsmth / AppDelegate.swift
Last active August 29, 2015 14:20
Quick hack to animate launch xib on launch
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
var showOverlay = true // whatever you want
### Keybase proof
I hereby claim:
* I am kvnsmth on github.
* I am kvnsmth (https://keybase.io/kvnsmth) on keybase.
* I have a public key whose fingerprint is C682 85C0 CA4A EDC7 D57E 271C CF79 7B08 1946 98D5
To claim this, I am signing this object:
@kvnsmth
kvnsmth / example-subtree-usage.md
Last active March 5, 2023 21:58
A real world usage for git subtrees.

Let's say you have an iOS project, and you want to use some external library, like AFNetworking. How do you integrate it?

With submodules

Add the project to your repo:

git submodule add [email protected]:AFNetworking/AFNetworking.git Vendor/AFNetworking

or something to that effect.

@kvnsmth
kvnsmth / Rakefile
Created November 26, 2012 18:20
Example Rakefile for distributing through TestFlight
PROJECT_NAME = "Awesome" # the name of your xcode project
APP_NAME = "Awesome" # whatever your app name is
@configuration = "Release" # xcode project configuration to use
@app_suffix = "-Staging"
SDK_VERSION = "5.1"
SDK_DIR = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator#{SDK_VERSION}.sdk"
BUILD_DIR = File.join(File.dirname(__FILE__), "build")
TESTFLIGHT_API_TOKEN = "TESTFLIGHT_API_TOKEN"
@kvnsmth
kvnsmth / get_oauth_access_token.rb
Created February 15, 2011 21:11
A quick script to get an OAuth access token
# run from a command line to get the access token information
require 'rubygems'
require 'oauth'
@consumer_key = "YOUR_CONSUMER_KEY"
@consumer_secret = "YOUR_CONSUMER_SECRET"
@consumer = OAuth::Consumer.new(@consumer_key, @consumer_secret, {
:site => "http://api.awesomeapp.com" # example: "http://api.twitter.com"
@kvnsmth
kvnsmth / processing_with_carrierwave.rb
Created October 15, 2010 15:59
Just some code that I threw together to play around with CarrierWave's image manipulation
require 'rubygems'
require 'carrierwave'
require 'fileutils'
# needed for the RMagick module in CarrierWave
def current_path
@current_path
end
include CarrierWave::RMagick
@kvnsmth
kvnsmth / open_browser_on_fail.rb
Created May 12, 2010 14:23
Need to debug a failed cucumber scenario? Try this.
=begin
From http://jonkinney.com/articles/2010/04/21/using-save_and_open_page-to-open-failed-cucumber-scenerios-in-a-browser-with-images-and-css/
I chose to put this code in a file under the features/support directory called: open_browser_on_fail.rb. If it's sitting next to the env.rb file itself then you have the new file in the right place.
Place the following code in that file and you'll be good to go!
=end
After do |scenario|
if scenario.status == :failed
save_and_open_page
end
/usr/local brew install git
==> Downloading http://kernel.org/pub/software/scm/git/git-1.6.6.1.tar.bz2
File already downloaded and cached to /Users/kevinsmith/Library/Caches/Homebrew
==> make prefix=/usr/local/Cellar/git/1.6.6.1 install
GIT_VERSION = 1.6.6.1
* new build flags or prefix
GEN git-am
GEN git-bisect
GEN git-difftool--helper
GEN git-filter-branch