Skip to content

Instantly share code, notes, and snippets.

View muncman's full-sized avatar

Kevin Munc muncman

View GitHub Profile
@phil-blain
phil-blain / .gitattributes
Last active March 29, 2024 22:38
Git pickaxe : show only relevant hunks (filter displayed hunks using the given search string)
*.md diff=markdown
import Foundation
let session = NSURLSession.sharedSession()
let requestIsBeingHandledKey = "RequestIsBeingHandledKey"
class CustomNSURLProtocol: NSURLProtocol {
override class func canInitWithRequest(request: NSURLRequest) -> Bool {
if NSURLProtocol.propertyForKey(requestIsBeingHandledKey, inRequest: request) != nil {
return false // Prevent recursize loop
@AlejandroJL
AlejandroJL / Configuration.md
Last active February 26, 2022 23:55
Xcode 5 automatic TestFlight build uploading and ready for Xcode Server CI Bots.
@vitorgalvao
vitorgalvao / Get Title and URL.applescript
Last active July 11, 2024 12:21
AppleScript and JavaScript for Automation to get frontmost tab’s url and title of various browsers.
-- AppleScript --
-- This example is meant as a simple starting point to show how to get the information in the simplest available way.
-- Keep in mind that when asking for a `return` after another, only the first one will be output.
-- This method is as good as its JXA counterpart.
-- Webkit variants include "Safari", "Webkit", "Orion".
-- Specific editions are valid, including "Safari Technology Preview".
-- "Safari" Example:
tell application "Safari" to return name of front document
@sjmadsen
sjmadsen / increment-build-counter.rb
Created July 18, 2012 13:38
Automatic Git revision stamping for Xcode projects
# Xcode auto-versioning script for Git by Steve Madsen.
# Adapted from Subversion script by Axel Andersson.
#
# This is a Ruby script. Use /usr/bin/ruby as the shell.
build_counter_file = 'build-counter'
raise "#{$0}: Must be run from Xcode" unless ENV['BUILT_PRODUCTS_DIR']
def development?
# This is part of a rakefile I use for UI Automation that's part of an
# upcoming (secret) project that I hope to announce soon.
# You need to set the $app_bundle global variable to point to the application's
# bundle on disk. Then hand in 1 for iPhone or 2 for iPad to this function
# and it will manipulate the plist of the device.
def pick_simulator_device index
# For now, the only way to tell UI Automation to run the iPad or iPhone
# simulator is to change the app bundle plist to require only that device.
@alexvollmer
alexvollmer / run-test-script
Created April 11, 2012 23:25
Wrapper script for running UIAutomation from the command-line
#!/usr/bin/env ruby -wKU
require "fileutils"
require "pty"
unless ARGV.length == 3
STDERR.puts "USAGE: run-test-script <app bundle> <test script> <output directory>"
exit 1
end
@johnbintz
johnbintz / gist:1809410
Created February 12, 2012 16:15
For the lazy, how to Guard::Guard your own Guard
# Guardfile
require 'guard/guard'
class ::Guard::JohnIsAwesome < ::Guard::Guard
def start
puts "Whoa a guard."
end
def run_all
" Use arrow keys to move buffers
map <up> <C-w>k<cr>
map <down> <C-w>j<cr>
map <left> <C-w>h<cr>
map <right> <C-w>l<cr>
@dlongmuir
dlongmuir / btserver_killer.rb
Created November 2, 2011 14:33
BTServer killer
#!/usr/bin/env ruby
# Kill crazy BTServer processes when the iPad simulator is running and
# you wake your Mac from sleeping
seconds_between_checking = 30
kill_threshold_percent = 10.0
while true do
ps_out_full = %x[ps aux | grep BTServer]