Skip to content

Instantly share code, notes, and snippets.

View skoch's full-sized avatar
🍋
Surly, since 1999.

Stephen Koch skoch

🍋
Surly, since 1999.
View GitHub Profile
@skoch
skoch / .bash_profile
Created April 2, 2012 19:27
my bash profile
export PS1="\[\e[31;40m\]____________________________________________________________________________________________________________________________\n| \[\e[33;40m\]\u@\[\e[32;40m\]\h \[\e[35;40m\]\t \[\e[36;40m\]\w \n\[\e[31;40m\]| $ \[\e[0m\]"
EDITOR=nano
export PATH="$PATH:~/git/git-achievements:/Library/Ruby/Gems/1.8/bin:/usr/local/git/bin"
alias git="git-achievements"
alias mate="/Users/skoch/bin/mate"
# alias cdf='cd `osascript -e "tell application \"Finder\" to if window 1 exists then if target of window 1 as string is not \":\" then get POSIX path of (target of window 1 as alias)"`'
@skoch
skoch / Default (OSX).sublime-keymap
Created June 6, 2012 23:01
Sublime Text 2 Key Bindings
[
{ "keys": ["ctrl+shift+d"], "command": "duplicate_line" },
{ "keys": ["super+shift+o"], "command": "insert_snippet", "args": {"name": "Packages/ActionScript 3/Out.sublime-snippet"}},
// { "keys": ["super+shift+o"], "command": "insert_snippet", "args": {"name": "Packages/JavaScript/console-log.sublime-snippet"}},
// { "keys": ["super+shift+t"], "command": "insert_snippet", "args": {"name": "Packages/ActionScript 3/trace.sublime-snippet"}},
{ "keys": ["super+shift+l"], "command": "insert_snippet", "args": {"contents": "console.log( '$SELECTION', $SELECTION );"}},
{ "keys": ["super+shift+i"], "command": "show_panel", "args": {"panel": "incremental_find", "reverse":false} },
{ "keys": ["super+enter"], "command": "build" },
{ "keys": ["super+t"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
@skoch
skoch / Preferences.sublime-settings
Created June 6, 2012 23:05
Sublime Text 2 Prefs
{
"auto_complete_commit_on_tab": false,
"auto_complete_delay": 150,
"auto_complete_with_fields": false,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Blackboard_3.tmTheme",
"draw_indent_guides": false,
"draw_minimap_border": true,
"draw_white_space": "none",
"font_face": "EnvyCodeR",
@skoch
skoch / toggle-hidden-files-mavericks
Created May 16, 2014 16:42
Toggle Hidden Files
try
set state to do shell script "defaults read com.apple.finder AppleShowAllFiles" as string
if state is "NO" then
do shell script "defaults write com.apple.finder AppleShowAllFiles YES && killall Finder"
else
do shell script "defaults write com.apple.finder AppleShowAllFiles NO && killall Finder"
end if
end try
@skoch
skoch / keybase.md
Created April 8, 2015 13:43
keybase.io

Keybase proof

I hereby claim:

  • I am skoch on github.
  • I am skoch (https://keybase.io/skoch) on keybase.
  • I have a public key whose fingerprint is 028C 43D8 6544 5E92 B7ED C776 8B03 2F53 9820 80CD

To claim this, I am signing this object:

@skoch
skoch / hmh-home-skip-buttons
Created June 9, 2015 14:37
Home & Skip button (HMH)
NSString *homeImageName = @"button-home";
NSString *homeImageBGName = @"button_bg";
NSString *skipImageName = @"button-skip";
NSString *skipImageBGName = @"button_bg";
CGRect frame = CGRectMake( -50, BUTTON_MARGIN_IPAD, 50, 50 );
if( IS_IPHONE )
{
frame = CGRectMake( -46, BUTTON_MARGIN_IPHONE, 46, 46 );
@skoch
skoch / setContentGutterForIphoneUsingView
Created June 12, 2015 16:59
All this to center content in a view for iPhones
- ( void )setContentGutterForIphoneUsingView:( UIView * )view
{
// macro to determine device
if( IS_IPHONE )
{
UIView *container = [UIView new];
container.backgroundColor = [UIColor clearColor];
container.translatesAutoresizingMaskIntoConstraints = NO;
UIView *content = [UIView new];
@skoch
skoch / hcs-naming-conventions.md
Last active October 5, 2016 19:53
Naming Conventions

HCS Naming Conventions

Files

  • No spaces, always lowercase
  • Hyphens for word boundaries, underscore for content/concern separation
  • IMAGES: bg/logo/graphic/icon prefix. Illustrates file purpose at a glance
@skoch
skoch / firebase-init-notification-setup.m
Created October 21, 2016 20:06
Firebase initialization and register for remote notifications
[FIRApp configure];
if( floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_9_x_Max )
{
// iOS 9
UIUserNotificationType allNotificationTypes = ( UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge );
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
}else
{
@skoch
skoch / firebase-appdelegate.h
Created October 21, 2016 20:11
Firebase AppDelegate.h
@import UserNotifications;
@import Firebase;
@import FirebaseMessaging;
@interface AppDelegate : UIResponder <UIApplicationDelegate, UNUserNotificationCenterDelegate, FIRMessagingDelegate>