Skip to content

Instantly share code, notes, and snippets.

View tombuildsstuff's full-sized avatar
🙃

Tom Harvey tombuildsstuff

🙃
View GitHub Profile
@davbeck
davbeck / assets.rb
Last active January 18, 2023 01:35
Automatic Enum-based Xcassets in Swift
#!/usr/bin/env ruby
require "active_support"
def assetCatalogsAtPath(path)
results = []
contents = Dir.entries(path)
@CodaFi
CodaFi / alltheflags.md
Last active June 2, 2024 17:09
Every Option and Flag /swift (1.2) Accepts Ever

#Every Single Option Under The Sun

  • optimization level options
  • automatic crashing options
  • debug info options
  • swift internal options
  • swift debug/development internal options
  • linker-specific options
  • mode options
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@staringispolite
staringispolite / asciiputsonglasses
Last active May 27, 2024 09:28
Ascii art sunglasses meme
Puts on glasses:
(•_•)
( •_•)>⌐■-■
(⌐■_■)
Takes off glasses ("mother of god..."):
(⌐■_■)
( •_•)>⌐■-■
@johnnonolan
johnnonolan / gist:36eb5b197d9e4de92e15
Created December 18, 2014 13:28
Node contractor
console.log "I can do a remote interview if needed."

ASCIIwwdc Viewing Statistics

June 1, 2014 – September 15, 2014

Percentage of total visits for sessions among the top 100 pages on ASCIIwwdc.

Initial Takeaways

  • Vast majority of views for 2014 sessions, as might be expected
  • Top 6 most-watched session all involve view controllers & Interface Builder (accounting for 1/4 of total traffic)
  • "What's New in X" sessions are extremely popular
@julianeon
julianeon / apisender.rb
Created August 26, 2014 23:51
A script that creates an incident using the PagerDuty API.
#!/usr/bin/env ruby
subdomain="CHANGE_THIS"
api_key="CHANGE_THIS"
incident_key="SORIA82E"
endpoint="https://events.pagerduty.com/generic/2010-04-15/create_event.json"
service_access_key="a9c73c38e9cf4fa197802c7f2eb25b78"
subject="This is a check_cron alert. This service is not running."
@ulrikdamm
ulrikdamm / gist:a9edb3516db7e9a13829
Created May 26, 2014 11:17
Xcide quicklook for UIColor
@interface UIColor (WBDebugExtensions)
@end
@implementation UIColor (DebugExtensions)
- (id)debugQuickLookObject {
UIGraphicsBeginImageContext(CGSizeMake(128, 128));
[self setFill];
[[UIBezierPath bezierPathWithRect:CGRectMake(0, 0, 128, 128)] fill];
#!/bin/bash
git branch --merged | while read line
do
# If the line is in the format '* master' (indicating the current branch),
# this will be effectively empty, so we don't somehow delete the current
# branch
BRANCH=`echo "$line" | awk -F '*' '{ print $1 }'`
if [ -z "$BRANCH" ]
@steipete
steipete / DevelopmentEnviromentDetector.m
Last active October 30, 2019 03:49
Detect if you're currently running a development version or an App Store/Ad Hoc version.
static BOOL PSPDFIsDevelopmentBuild(void) {
#if TARGET_IPHONE_SIMULATOR
return YES;
#else
static BOOL isDevelopment = NO;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// There is no provisioning profile in AppStore Apps.
NSData *data = [NSData dataWithContentsOfFile:[NSBundle.mainBundle pathForResource:@"embedded" ofType:@"mobileprovision"]];
if (data) {