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
### Continuous Integration; PHP | |
> RM 12.3.14 | |
### What this is about | |
* Here is what I have done with CI for a PHP project. | |
* Key aim is knowledge sharing and if sessions like this are value. |
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
XCTAssert(expression, format...) | |
XCTAssertEqual(a1, a2, format...) | |
XCTAssertEqualObjects(a1, a2, format...) | |
XCTAssertEqualWithAccuracy(a1, a2, accuracy, format...) | |
XCTAssertFalse(expression, format...) | |
XCTAssertNotEqual(a1, a2, format...) | |
XCTAssertNotEqualObjects(a1, a2, format...) | |
XCTAssertNotEqualWithAccuracy(a1, a2, accuracy, format...) | |
XCTAssertNoThrow(expression, format...) | |
XCTAssertNoThrowSpecific(expression, specificException, format...) |
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
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
//background processing goes here | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
//update UI here | |
}); | |
}); |
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
Show hidden characters
{ | |
"detect_slow_plugins": true, | |
"remember_open_files": true, | |
"hot_exit": false, | |
"auto_complete_commit_on_tab": true, | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ |
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
# Git credentials | |
GIT_AUTHOR_NAME="Rob Murray" | |
GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" | |
git config --global user.name "$GIT_AUTHOR_NAME" | |
GIT_AUTHOR_EMAIL="robmurray17@gmail.com" | |
GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL" | |
git config --global user.email "$GIT_AUTHOR_EMAIL" |
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 sublg { bundle show $@ | xargs subl; } |
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
# inside fork dir | |
git remote add upstream ORIGINAL_REPO | |
git fetch upstream | |
# pull upstream branch | |
git pull upstream {branch} | |
# rebase a branch | |
git rebase upstream/{branch} |
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
class MatchingPageSlugValidator < ActiveModel::Validator | |
def validate(record) | |
# Ancestry gem #siblings includes current record, exclude this if present | |
exclude_self = record.try(:id) ? ['id <> ?', record.id] : [] | |
sibling_slugs = record.siblings.where(exclude_self).pluck(:slug) | |
if sibling_slugs.include?(record.slug) | |
record.errors[:slug] << 'belongs to another page at this level.' | |
end | |
end |
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
dig -t txt _amazonses.host-domain.co.uk +short |
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 ruby | |
require 'optparse' | |
require 'mini_exiftool' | |
# Check images in a directory for valid EXIF image creation date and update if necessary. | |
# Can be used to fix older photos that do not have to the correct EXIF `date_time_original` field data. | |
# | |
# If not present then attempt fallback and update `date_time_original` field | |
# If fallback not available then otherwise prompt for input or use default date. |
OlderNewer