This file contains hidden or 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 | |
osascript -e "tell application \"Finder\" to set label index of alias POSIX file \"$1\" to 2" |
This file contains hidden or 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 | |
hdiutil create -fs HFS+ -srcfolder "$1" -volname "$(basename $1)" "$1.dmg" | |
tar -cjf "$1.tar.bz2" -C "$(dirname $1)" "$(basename $1)" |
This file contains hidden or 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 filter-branch --force --index-filter 'git rm --cached --ignore-unmatch FILE_TO_DELETE' --prune-empty --tag-name-filter cat -- --all |
This file contains hidden or 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
import Foundation | |
extension String { | |
func regex(_ pattern: String) -> Bool { | |
return self.range(of: pattern, options: .regularExpression) != nil | |
} | |
} | |
let pattern = "http[s]?://[w]*.?booking.com.*aid=[0-9]+" |
This file contains hidden or 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
import Foundation | |
// Further Reading: | |
// https://technet.microsoft.com/en-us/library/aa258277(v=sql.80).aspx | |
// http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns | |
// http://www.w3.org/TR/NOTE-datetime |
This file contains hidden or 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
import Foundation | |
extension Date { | |
func timeAgo() -> String { | |
let calendar = Calendar.current | |
let seconds = calendar.dateComponents([.second], from: self, to: Date()).second! | |
let minutes = calendar.dateComponents([.minute], from: self, to: Date()).minute! |
This file contains hidden or 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
BEFORE = 0.25 # Percent commission before the limit | |
LIMIT = 50000 # The commission boundary | |
AFTER = 0.20 # Percent after the boundary | |
# The only number to change is this one! No spaces, dots or commas...! | |
total_price_including_commssion = 10000000 | |
# Warning - Do not use for bids over a £1,000,000 Hammer |
This file contains hidden or 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
module VatCalc | |
def VatCalc.vat_rate | |
@vat_rate ||= BigDecimal.new('20') | |
end | |
def VatCalc.vat_rate=(value) | |
@vat_rate = BigDecimal.new(value.to_s) | |
end |
This file contains hidden or 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
# Turn on the simulator screen capture | |
xcrun simctl io booted recordVideo ~/simulator.mov | |
# Convert the iPhone 6s screen shot into a gif: | |
ffmpeg -i ~/simulator.mov -vf scale=320:-1 -r 6 -f gif -y simulator.gif |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains hidden or 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
mr Marathi | |
bs Bosnian | |
ee_TG Ewe (Togo) | |
ms Malay | |
kam_KE Kamba (Kenya) | |
mt Maltese | |
ha Hausa | |
es_HN Spanish (Honduras) | |
ml_IN Malayalam (India) | |
ro_MD Romanian (Moldova) |
NewerOlder