This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This will grab the largest image for the pixelRatio without oversampling (iOS style) | |
// Usage: assetUsingNativePixelRatio('/assets/images', 'logo', 'png', [1,2,3]); | |
// Output: /assets/images/[email protected] | |
function assetUsingNativePixelRatio(path, name, extension, pixelRatios) { | |
// Sort the pixelRatios in case they were put in the wrong order | |
var $pixelRatios = $(pixelRatios).sort(); | |
// Price is right style | |
var matchingPixelRatio = $pixelRatios.not(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pattern *support.appblade.com\/login\/new | |
$('#user_session_email').val('USERNAME'); | |
$('#user_session_password').val('PASSWORD')[0].form.submit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Returns either true or false depending on whether or not the user agent of | |
# the device making the request is matched to a device in our regex. | |
def is_mobile_device? | |
request.user_agent.to_s.downcase =~ /silk|palm|blackberry|nokia|phone|midp|mobi|symbian|chtml|ericsson|minimo|audiovox|motorola|samsung|telit|upg1|windows ce|ucweb|astel|plucker|x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\\.b|webos|amoi|novarra|cdm|alcatel|pocket|ipad|iphone|mobileexplorer|mobile/ | |
end | |
# Can check for a specific user agent | |
# e.g., is_device?('iphone') or is_device?('mobileexplorer') | |
def is_device?(type) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "minitest/autorun" | |
# Usage: IosVersion.new('11A4372q') #=> '7.0b1' | |
class IosVersion | |
IOS = { | |
'7' => [ | |
3, { | |
'D' => [[1, 2]], | |
'E' => [[1, 3]], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Incident Identifier: [TODO] | |
CrashReporter Key: [TODO] | |
Hardware Model: iPod5,1 | |
Process: Clock [3512] | |
Path: /var/mobile/Applications/BC0783D7-3F57-4317-A0C7-BCEBE1AB9632/Clock.app/Clock | |
Identifier: com.raizlabs.clockradio | |
Version: 2.3.5 | |
Code Type: ARM | |
Parent Process: launchd [1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get a Continuous Integration Token on AppBlade.com | |
# while on your project details page. If you don't | |
# have a project yet, you'll have to create one. | |
CI_TOKEN=YOUR_PROJECTS_CI_TOKEN | |
BUNDLE_PATH=/path/to/bundle | |
# Optional arguments | |
ZIPPED_DSYM_PATH=/path/to/a/zipped/dsym | |
OVERRIDE_BUNDLE_VERSION_STRING=0.0.1 | |
CHANGELOG="Some changes bro" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Look up all the tags, grep for any on this commit, excluding jenkins-build tags | |
TAGGED_RELEASE=`git show-ref --tags --dereference | grep \`git rev-parse HEAD\` | awk '$2 !~ /refs\/tags\/jenkins(.+)\^\{\}/ { print $2 }'` | |
# Any results? | |
if [ -n "$TAGGED_RELEASE" ] | |
then | |
# If there was a match, we are on a tagged release (or many), normalize them, and grab the first one | |
GIT_TAG=`echo $TAGGED_RELEASE | tr "^{}" " " | tr "/refs/tags/" " " | awk -F" " '{print $1}'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# some variables we'll use later on | |
PROJECT_PATH=${WORKSPACE}/trunk | |
SIGNING_PATH=${PROJECT_PATH}/Signing | |
APP=Clock | |
XCODEPROJ_PATH="${PROJECT_PATH}/${APP}.xcodeproj" | |
XCODE_TARGET_NAME=${APP}.app | |
DSYM_NAME=${XCODE_TARGET_NAME}.dSYM | |
BUILD_PATH=${PROJECT_PATH}/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Push tagged commits to AppBlade | |
# https://appblade.com/api | |
# Look up all the tags, grep for any on this commit, excluding jenkins-build tags | |
TAGGED_RELEASE=`git show-ref --tags --dereference | grep \`git rev-parse HEAD\` | awk '$2 !~ /refs\/tags\/jenkins(.+)\^\{\}/ { print $2 }'` | |
# Any results? | |
if [ -n "$TAGGED_RELEASE" ] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function savemyshitbro { | |
git stash | |
git checkout -b $1 | |
git stash apply | |
git push origin $1 | |
} | |
// $savemyshitbro BRANCH_NAME | |
// usage: savemyshitbro changes_to_something |