![]() |
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
| # Sleep 5 tries to avoid Heroku truncating the output by terminating the connection before everything has transferred. | |
| # Dump structure.sql as heroku_structure.sql | |
| heroku run 'bundle exec rake db:structure:dump && cat db/structure.sql && sleep 5' --app app-name > db/heroku_structure.sql | |
| # Dump schema.rb as heroku_schema.db | |
| heroku run 'bundle exec rake db:schema:dump && cat db/schema.rb && sleep 5' --app app-name > db/heroku_schema.rb |
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
| // Do you often find yourself writing lines of code that look like this? | |
| // let viewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("ViewController") as! ViewController | |
| // Here's a simpler way, using generics and Swift type-casting (as long as the viewcontroller's storyboard identifier is its class name). | |
| // Now you can write: let viewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController() as ViewController | |
| extension UIStoryboard { | |
| func instantiateViewController<T: UIViewController>() -> T { | |
| guard let vc = instantiateViewControllerWithIdentifier(String(T)) as? T else { | |
| fatalError("Could not locate viewcontroller with with identifier \(String(T)) in storyboard.") | |
| } |
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
| function newlaravel | |
| { | |
| # Modify to suit your own system | |
| YAML=/home/users/Nathan/Homestead.yaml | |
| PROJECTSDIR="/media/nathan/Secondary Storage/Github" | |
| HOMESTEADDIR="/media/nathan/Secondary Storage/Github" | |
| HOSTFILE=/etc/hosts | |
| PROJECTNAME=$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
| // This syntax reflects changes made to the Swift language as of Aug. '16 | |
| extension UIView { | |
| // Example use: myView.addBorder(toSide: .Left, withColor: UIColor.redColor().CGColor, andThickness: 1.0) | |
| enum ViewSide { | |
| case Left, Right, Top, Bottom | |
| } | |
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
| <?php | |
| namespace App\Helpers; | |
| /* | |
| * Access the US States in a format of your choosing by simply calling: | |
| * UsStates::getStates(array $format, bool $stateAllCaps, bool $includeTerritories) | |
| * check the getStates method below for more details on how to format | |
| */ | |
| class UsStates | |
| { | |
| public static $usStates = [ |
OlderNewer
