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
extension Bundle { | |
public func decode<T: Decodable>(_ type: T.Type, | |
from file: String, | |
dateDecodingStategy: JSONDecoder.DateDecodingStrategy = .deferredToDate, | |
keyDecodingStrategy: JSONDecoder.KeyDecodingStrategy = .useDefaultKeys) -> T { | |
guard let url = self.url(forResource: file, withExtension: nil) else { | |
fatalError("Failed to locate \(file) in bundle.") | |
} | |
guard let data = try? Data(contentsOf: url) else { | |
fatalError("Failed to load \(file) from bundle.") |
This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).
This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)
- Installing Homebrew is effortless, open Terminal and enter :
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
- HTTP 形式:
git clone https://github.com/owner/git.git
- SSH 形式:
git clone [email protected]:owner/git.git
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
# xcode-build-bump.sh | |
# @desc Auto-increment the build number every time the project is run. | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases Tab | |
# 3. Select: Add Build Phase -> Add Run Script | |
# 4. Paste code below in to new "Run Script" section | |
# 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) |
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
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
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
/* upload-popup */ | |
.upload-popup-all {position: absolute;width:281px;padding: 10px;border:1px solid #959ba5;background-color: #eef0f3;} | |
.upload-popup-all .describe {float:left;font-size:13px;line-height:123%;color:rgb(101,101,101);text-shadow:0px 1px 0px rgba(255,255,255,0.5);} | |
.upload-popup-all .details {float: right; color: #3e9de3;text-decoration: underline;} | |
.upload-popup-all .schedule {height: 14px;width:280px;margin-top: 3px;position: relative;background:url(../images/upload-fffbg.png) no-repeat;/*overflow:hidden;*/} | |
.upload-popup-all .schedule-bg {height: 11px;width:100%;position: absolute;bottom:1px;border:1px solid #3e9de3;background-color: #6dbef2;} | |
.upload-popup-all .schedule-com-bg {height: 11px;width:100%;position: absolute;border:1px solid #70b05c;background-color: #ace17d;} | |
.upload-popup-all ul {max-height:131px;margin-top: 15px;margin-bottom: 10px;border: 1px solid #b2b9bd;overflow: auto;} | |
.upload-popup-all li:last-child {margin-bottom: 0;} | |
.upload-popup-list {height:25px;width:100px; text-ind |