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 | |
echo -e "##=====> changing default shell to /bin/bash" | |
chsh -s /bin/bash | |
echo -e "##=====> installing homebrew" | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | |
echo -e "##=====> refreshing the environment" |
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 downsample(imageAt imageURL: URL, | |
to pointSize: CGSize, | |
scale: CGFloat = UIScreen.main.scale) -> UIImage? { | |
// Create an CGImageSource that represent an image | |
let imageSourceOptions = [kCGImageSourceShouldCache: false] as CFDictionary | |
guard let imageSource = CGImageSourceCreateWithURL(imageURL as CFURL, imageSourceOptions) else { | |
return nil | |
} | |
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 UIKit | |
@objc public protocol TimerLabelDelegate { | |
optional func countdownStarted() | |
optional func countdownFinished() | |
} | |
public extension NSTimeInterval { | |
var int: Int { |
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 Int { | |
func times(b: (Int) -> ()) { | |
for i in 0..<self { | |
b(i) | |
} | |
} | |
} | |
3.times { print($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
# Xcode | |
build/* | |
*.pbxuser | |
!default.pbxuser | |
*.mode1v3 | |
!default.mode1v3 | |
*.mode2v3 | |
!default.mode2v3 | |
*.perspectivev3 | |
!default.perspectivev3 |
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
// | |
// Calculator.swift | |
// | |
// Created by Mohamed Hegab on 8/22/15. | |
// Copyright (c) 2015 The Dark Dimension. All rights reserved. | |
// | |
import UIKit | |
/// The alignment for drawing an String inside a bounding rectangle. |