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 | |
DATESTAMP=`date "+%Y-%m-%d-%H-%M-%S"` | |
MOPIDY_CONFIG_DIR="$HOME/.config/mopidy" | |
MOPIDY_CONFIG="$MOPIDY_CONFIG_DIR/mopidy.conf" | |
MOPIDY_SUDOERS="/etc/sudoers.d/010_mopidy-nopasswd" | |
MOPIDY_DEFAULT_CONFIG="$MOPIDY_CONFIG_DIR/defaults.conf" | |
EXISTING_CONFIG=false | |
PYTHON_MAJOR_VERSION=3 | |
PIP_BIN=pip3 |
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
/* | |
* Block Safety | |
* | |
* We sometimes accidentally invoke a nil block...this protects against it. | |
* | |
*/ | |
#define SAFE_CALL(b, ...) \ | |
if(b) b(__VA_ARGS__); |
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
/* | |
* Strongify / Weakify shortcuts | |
* | |
* These declare and instantiate weak and strong variables | |
* statically so it's easier to write. It's a nice middle-ground | |
* when compared to other solutions in the wild. | |
* | |
*/ | |
#define WEAKIFY(aSelf) __weak typeof(aSelf) weakSelf = aSelf; | |
#define STRONGIFY(aSelf) __strong typeof(aSelf) strongSelf = aSelf; |
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
/** | |
* Lazy Getter | |
* | |
* Helps reduce silly errors when writing lazy getters. | |
*/ | |
#define ADD_LAZY_GETTER(type, name, initialValueBlock) \ | |
-(type)name \ | |
{ \ | |
if (!_##name) { \ | |
_##name = initialValueBlock(); \ |
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 is my preferred .bash_profile | |
# | |
# It has more context around git repositories, coloring, etc. Sections of this .bash_profile | |
# were certainly inspired by others' files (especially the git aliases). | |
# | |
export GITAWAREPROMPT=~/.bash/git-aware-prompt | |
source "${GITAWAREPROMPT}/main.sh" |
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
# | |
# Shows one way to fail a build in fastlane when code | |
# coverage does not meet a minimum threshold. | |
# | |
# there are other ways to check the coverage of the commit, | |
# but I couldn't find an existing tool that makes this easier | |
# that will run on bitrise. I would have normally used diff-cover | |
# to do this because you can compare branches and only check the diffs. | |
# Unfortunately that means you have to find a way to install it on bitrise | |
# at the time of writing and that can be tricky. |
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
/** | |
* Lazily initializes an object. Mainly used for reducing boilerplate code. | |
*/ | |
#define DEFINE_LAZY_GETTER(type, name, initialValueBlock) \ | |
- (type)name { \ | |
if (! _ ## name) { \ | |
_ ## name = initialValueBlock(); \ | |
} \ | |
return _ ## name; \ | |
} |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Localize.py - Incremental localization on XCode projects | |
# João Moreno 2009 | |
# http://joaomoreno.com/ | |
# Modified by Steve Streeting 2010 http://www.stevestreeting.com | |
# Changes | |
# - Use .strings files encoded as UTF-8 |
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 | |
# find all .m files and pump it through genstrings, outputting it to en.lproj/Localizable.strings | |
find . -name '*.m' | xargs genstrings -o en.lproj |
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
/* | |
* Downloading files using AFNetworking is not a 1-step process, but it's still pretty easy. | |
* | |
* NOTE: If you're downloading a file from S3, make sure to set the proper Content-Type. For example, | |
* a zip file should ideally have the content type of application/zip. | |
* | |
* Inspired by various sources online. | |
*/ | |
#pragma mark - Downloading Files |
NewerOlder