Skip to content

Instantly share code, notes, and snippets.

Ed McManus emcmanus

Block or report user

Report or block emcmanus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@emcmanus
emcmanus / snakeToCamelCase.js
Last active Aug 31, 2018 — forked from felixjung/snakeToCamelCase.js
ES6 module to recursively convert snake case keys in an object to camel case using lodash.
View snakeToCamelCase.js
'use strict';
/**
* @example
* import keysToCamelCase from './snakeToCamelCase';
* keysToCamelCase({bad_key: 1}); => {badKey: 1}
* keysToCamelCase([{bad_key: 1}]); => [{badKey: 1}]
*/
function keysToCamelCase(object) {
@emcmanus
emcmanus / NSDate+TimeAgoInWords.swift
Created Oct 3, 2014
A Swift port of Rails' time_ago_in_words.
View NSDate+TimeAgoInWords.swift
//
// NSDate+TimeAgoInWords.swift
//
// A Swift port of Rails' time_ago_in_words.
// Created by Ed McManus for Yardsale on 9/30/14.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
@emcmanus
emcmanus / gist:6065901
Created Jul 23, 2013
Parse.Promise Edge Cases
View gist:6065901
try
Parse.Promise.as().then( ->
Parse.Promise.as 1, 2, 3
).then((a, b, c) ->
# a, b, and c all have values
console.error "1. a: #{a}, b: #{b}, c: #{c}"
)
# Can we transform Parse.Promise.error into a success?
Parse.Promise.error().then( null, (error) ->
@emcmanus
emcmanus / gist:5630504
Created May 22, 2013
Clean whitespace from objective-c source.
View gist:5630504
find . -name "*.[hm]" -type f -print0 | xargs -0 sed -i '' -E "s/[[:space:]]*\$//"
@emcmanus
emcmanus / PFObject+YSComparison.h
Last active Dec 12, 2015
Objective-C isEqual implementation for Parse objects (PFObject, PFFile, and PFRelation)
View PFObject+YSComparison.h
//
// PFObject+YSComparison.h
//
// Created by Ed McManus for Yardsale Inc. on 2/1/13
// Learn more at https://getyardsale.com
//
// Requires BlocksKit https://github.com/pandamonia/BlocksKit
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@emcmanus
emcmanus / gist:2894558
Created Jun 8, 2012
Git Status in FishFish Prompt - Fish port of __git_ps1
View gist:2894558
# Port of __git_ps1 for Fish shell (tested with FishFish)
#--------------------------------------------------------------------------------------------------
# https://github.com/bjeanes/dot-files/tree/294254ce2f064bbfc586e98107da1ed510898ffd/fish/functions
# via @bjeanes - https://github.com/bjeanes
function __git_ps1
set -l g (git rev-parse --git-dir ^/dev/null)
if [ -n "$g" ]
set -l r ""
set -l b ""
@emcmanus
emcmanus / Chainable.rb
Created May 13, 2012
Simple paperclip processor that allows you to chain image styles.
View Chainable.rb
#
# Chainable.rb
#
# Allows you to chain Paperclip styles.
# Created by Ed McManus for Yardsale Inc. on 5/12/2012
#
#
# *********************************************************************
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@emcmanus
emcmanus / RKObjectManager+Blocks.h
Created Apr 14, 2012
Block-based API Wrapper for Restkit (Requires A2DynamicDelegate)
View RKObjectManager+Blocks.h
//
// RKObjectManager+Blocks.h
//
// Created by Ed McManus for Yardsale Inc. on 3/27/12
// Learn more at https://getyardsale.com
//
// Requires A2DynamicDelegate https://github.com/pandamonia/A2DynamicDelegate
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@emcmanus
emcmanus / hack.sh
Created Apr 5, 2012 — forked from erikh/hack.sh
OSX For Hackers
View hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
View gist:1840262
- (id) initWithDefaultLocationName: (NSString *) defaultLocationName defaultLatitude: (double) defaultLatitude defaultLongitude: (double) defaultLongitude preactivation: (BOOL) preactivation viewedPromotions: (NSArray *) viewedPromotions incomingEmailAddress: (NSString *) incomingEmailAddress recentMailedAddresses: (NSArray *) recentMailedAddresses comments: (NSString *) comments dateAgreedToTermsOfService: (EDAMTimestamp) dateAgreedToTermsOfService maxReferrals: (int32_t) maxReferrals referralCount: (int32_t) referralCount refererCode: (NSString *) refererCode sentEmailDate: (EDAMTimestamp) sentEmailDate sentEmailCount: (int32_t) sentEmailCount dailyEmailLimit: (int32_t) dailyEmailLimit emailOptOutDate: (EDAMTimestamp) emailOptOutDate partnerEmailOptInDate: (EDAMTimestamp) partnerEmailOptInDate preferredLanguage: (NSString *) preferredLanguage preferredCountry: (NSString *) preferredCountry clipFullPage: (BOOL) clipFullPage twitterUserName: (NSString *) twitterUserName twitterId: (NSString *) twitterId group
You can’t perform that action at this time.