Skip to content

Instantly share code, notes, and snippets.

@evanlong
evanlong / LWHangDetector.h
Last active November 17, 2016 16:06
Simple Hang Detection
/**
Copyright (C) 2011 Evan Long
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
@hartym
hartym / git-stash-grep
Created May 3, 2012 09:45 — forked from netshade/gist:1125810
git stash grep (bash)
stashgrep() {
for i in `git stash list | awk -F ':' '{print $1}'`; do
git stash show -p $i | grep -H --label="$i" "$1"
done
}
@skabber
skabber / hockeyCrashes.py
Created April 10, 2013 23:22
A Python script to graph all your production app crashes in Status Board
#!/usr/bin/env python
import requests
import json
import StringIO
import datetime
hockeyToken = 'getyourowndamnkey'
appsEndpoint = 'https://rink.hockeyapp.net/api/2/apps'
crashesEndpoint = 'https://rink.hockeyapp.net/api/2/apps/%s/crashes/histogram?api_token=%s&format=json&start_date=%s&end_date=%s'
@shiningabdul
shiningabdul / gist:8634264
Last active January 4, 2016 14:28
Xcode Bot Archive Post-Build Script to Upload Automatically to HockeyApp. Updated from here to use Hockey App: http://developmentseed.org/blog/2011/sep/02/automating-development-uploads-testflight-xcode/.
# Valid and working as of 04/21/2014
# Xcode 5.0.1, XCode Server
#
#Settings
API_TOKEN="This can be found here: https://rink.hockeyapp.net/manage/auth_tokens"
DISTRIBUTION_LISTS="This is a comma seperated list of tags found under App -> Users -> "
PROVISIONING_PROFILE="You will have to manually copy your profile to /Library/Server/Xcode/Data/ProvisioningProfiles/<profile>.mobileprovision"
#EXAMPLE:"/Library/Server/Xcode/Data/ProvisioningProfiles/DocLink_InHouse_2013.mobileprovision"
NOTIFY="1"
@djromero
djromero / update_provisioning_profile.sh
Last active February 6, 2024 12:13
Download and install a single iOS provisioning profile for Xcode
#!/bin/sh
#
# Download and install a single iOS provisioning profile
# Requires https://github.com/nomad/cupertino
#
# Usage
# - Login to your account once:
# ios login
# - Configure TEAM and PROFILE (instructions below)
# - Run update_provisioning_profile.sh at anytime, usually after adding/removing devices to the profile
#!/bin/sh
#
# Download and install iOS provisioning profiles
# Requires https://github.com/nomad/cupertino
#
# Usage
# - Login to your account once:
# ios login
# - Configure TEAM and PROFILE (instructions below)
# - Run update_provisioning_profile.sh at anytime, usually after adding/removing devices to the profile
@djromero
djromero / pre-commit
Last active December 2, 2015 16:50
Git pre-commit hook to detect debugging stuff that shouldn't be commited.
#!/bin/sh
# commit without hook:
# git commit --no-verify
#
declare -i REJECTED
REJECTED=0
red="\033[31m"
reset="\033[m"
@daneden
daneden / Instructions.md
Created December 1, 2015 00:25
Remap Caps Lock to Emoji on Mac

How to remap the caps lock key to the emoji selector on Mac

  1. Go to System Preferences -> Keyboard -> Modifier Keys...
  2. Change “Caps Lock” to “No action”
  3. Install Seil
  4. Change the Caps Lock key in Seil to keyCode 80 (F19)
  5. Install Karabiner
  6. Open Karabiner and go to Misc & Uninstall -> Open private.xml
  7. Copy the contents of this gist's example to the XML file and save
  8. In Karabiner, go to Change Keys -> Reload XML
@pedromancheno
pedromancheno / HTTP.swift
Created February 21, 2017 11:44
Wrapper for URLSession for making HTTP Requests.
import Foundation
enum Result<T> {
case success(T?)
case failure(Error)
}
enum HTTPError: Error {
case noResponse
case unsuccesfulStatusCode(Int)
@jcavat
jcavat / Dockerfile
Last active February 25, 2024 13:58
docker-compose with php/mysql/phpmyadmin/apache
FROM php:7.1.2-apache
RUN docker-php-ext-install mysqli