View Geocoder.swift
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
let geocoder = CLGeocoder() | |
let location = CLLocation(latitude: 47.640320, longitude: -122.134400) | |
geocoder.reverseGeocodeLocation(location) { (addressList, error) in | |
if let error = error { | |
print("Unable to Reverse Geocode Location (\(error))") | |
} else { | |
print(addressList?.first?.compactAddress ?? "No Matching Addresses Found") | |
} | |
} |
View MSBuildSnippet.csproj
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
<ItemGroup> | |
<_FilesToBeCopied Include="$(ProjectDir)\SourceDirectory\**\*.extension" /> | |
</ItemGroup> | |
<Target Name="CopyFiles" AfterTargets="build"> | |
<Copy SourceFiles="@(_FilesToBeCopied)" | |
DestinationFolder="$(OutputPath)\TargetDirectory\%(RecursiveDir)" | |
SkipUnchangedFiles="false" | |
OverwriteReadOnlyFiles="true" | |
Retries="3" | |
RetryDelayMilliseconds="300" /> |
View swiftkata.rb
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/ruby | |
kata_name = ARGV[0] | |
if kata_name == nil then | |
puts "You must provide a Kata name." | |
exit | |
end | |
LICENSEFILE = %Q{MIT License |
View domoticzBackup.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
#!/bin/bash | |
BACKUP_SERVER=mac-mini-server.local | |
BACKUP_PORT=2222 | |
BACKUP_USERNAME=domoticz | |
DOMOTICZ_SERVER=127.0.0.1 | |
DOMOTICZ_PORT=8080 | |
DOMOTICZ_DIR="/home/pi/domoticz" | |
DOMOTICZ_WWW_DIR="$DOMOTICZ_DIR/www" |
View Domoticz Pi setup
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
Expand file-system to allow access to the entire SD card | |
sudo raspi-config | |
-- | |
Enable SSH and logging | |
sudo nano /etc/init.d/domoticz.sh |
View pre-commit
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/sh | |
git diff-index --name-status --cached HEAD -- | cut -c3- | while read FILE | |
do | |
if git diff --cached "$FILE" | grep -q "^+[^+].*// NOCOMMIT"; then | |
echo $FILE ' contains a NOCOMMIT string!' | |
exit 1 | |
fi | |
done |
View SourceTree-GitLab.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
#!/bin/bash | |
REPO_DIR=$1 | |
SHA=$2 | |
cd $REPO_DIR | |
GITLAB_URL=`git remote get-url origin | sed -e 's/git@//' -e 's/:/\//' -e 's/\.git//'` | |
open "https://$GITLAB_URL/commit/$SHA" |
View list-deleted-stashes.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
git log --graph --oneline --decorate $( git fsck --no-reflog | awk '/dangling commit/ {print $3}' ) | |
#git stash apply $SHA |
View XCTestCase+OffTopic.swift
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
// | |
// XCTestCase+OffTopic.swift | |
// | |
// Created by Steve Wilford on 21/11/2015. | |
// Copyright © 2015 Off Topic. All rights reserved. | |
// | |
import XCTest | |
extension XCTestCase { |
NewerOlder