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
hdiutil convert -format UDRW -o /pfad/der/ZIELDATEI.img /pfad/der/QUELLDATEI.iso | |
mv /pfad/der/KONVERTIERTENDATEI.img.dmg /pfad/der/NEUENDATEI.img | |
diskutil list | |
diskutil unmountDisk /dev/disk? | |
sudo dd if=/pfad/der/DATEI.img of=/dev/rdisk? bs=1m |
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
extension Data { | |
var md5 : String { | |
var digest = [UInt8](repeating: 0, count: Int(CC_MD5_DIGEST_LENGTH)) | |
_ = self.withUnsafeBytes { bytes in | |
CC_MD5(bytes, CC_LONG(self.count), &digest) | |
} | |
var digestHex = "" | |
for index in 0..<Int(CC_MD5_DIGEST_LENGTH) { | |
digestHex += String(format: "%02x", digest[index]) | |
} |
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
// add your view as observer | |
func addVideoBoundsObserver(){ | |
playerController?.contentOverlayView?.addObserver(self, forKeyPath: "bounds", options: .new, context: nil) | |
} | |
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { | |
if keyPath == "bounds" { | |
guard let new = change?[NSKeyValueChangeKey.newKey] as? CGRect | |
else { return } | |
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
extension TimeInterval { | |
func durationString(_ decimal: Bool) -> String { | |
if decimal { | |
let formatter = NumberFormatter() | |
formatter.minimumFractionDigits = 2 | |
formatter.maximumFractionDigits = 2 | |
formatter.minimumIntegerDigits = 1 | |
let a = self / 3600 | |
return formatter.string(from: NSNumber(value: a))! + " h" | |
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
$ sudo apt-get install -y gcc-multilib g++-multilib libffi-dev libffi6 libffi6-dbg python-crypto python-mox3 python-pil python-ply libssl-dev zlib1g-dev libbz2-dev libexpat1-dev libbluetooth-dev libgdbm-dev dpkg-dev quilt autotools-dev libreadline-dev libtinfo-dev libncursesw5-dev tk-dev blt-dev libssl-dev zlib1g-dev libbz2-dev libexpat1-dev libbluetooth-dev libsqlite3-dev libgpm2 mime-support netbase net-tools bzip2 | |
$ wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz | |
$ tar xvf Python-2.7.10.tgz | |
$ cd Python-2.7.10/ | |
$ ./configure --prefix /usr/local/lib/python2.7.10 --enable-ipv6 | |
$ make | |
$ sudo make install |
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
setenv("CFNETWORK_DIAGNOSTICS", "3", 1) // in AppDelegate „didFinishLaunchingWithOptions“ einbinden. |
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
The problem with the other two answers is that the new master doesn't have the old master as an ancestor, so when you push it, everyone else will get messed up. This is what you want to do: | |
git checkout better_branch | |
git merge --strategy=ours master # keep the content of this branch, but record a merge | |
git checkout master | |
git merge better_branch # fast-forward master up to the merge | |
If you want your history to be a little clearer, I'd recommend adding some information to the merge commit message to make it clear what you've done. Change the second line to: | |
git merge --strategy=ours --no-commit master |
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
func URLSession(session: NSURLSession, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) { | |
if challenge.protectionSpace.authenticationMethod == (NSURLAuthenticationMethodServerTrust) { | |
let serverTrust:SecTrustRef = challenge.protectionSpace.serverTrust! | |
let certificate: SecCertificateRef = SecTrustGetCertificateAtIndex(serverTrust, 0)! | |
let remoteCertificateData = CFBridgingRetain(SecCertificateCopyData(certificate))! | |
let cerPath: String = NSBundle.mainBundle().pathForResource("xyz.com", ofType: "cer")! | |
let localCertificateData = NSData(contentsOfFile:cerPath)! |
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
for family: String in UIFont.familyNames() | |
{ | |
print("\(family)") | |
for names: String in UIFont.fontNamesForFamilyName(family) | |
{ | |
print("== \(names)") | |
} | |
} |
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
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
source ~/.bash_alias #get aliases |