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
//: # Ruby Array push | |
func << <T>(inout left: [T], right: T) -> [T] { | |
left.append(right) | |
return left | |
} | |
func << <T>(inout left: [T], right: [T]) -> [T] { | |
left += right | |
return left | |
} |
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
class FoodTableViewCell: UITableViewCell { | |
@IBOutlet weak var nameLabe: UILabel! | |
@IBOutlet weak var checkbox: CheckBox! | |
} |
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 String { | |
func toDate(format: String) -> NSDate? { | |
let dateFormatter = NSDateFormatter() | |
dateFormatter.dateFormat = format | |
return dateFormatter.dateFromString(self) | |
} | |
} | |
extension NSDate { | |
func toString(format: String) -> String { |
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
// ---- | |
// Sass (v3.4.9) | |
// Compass (v1.0.1) | |
// ---- | |
$media-break: 1024px; | |
@function vw($px, $base-width: $media-break){ | |
@return ($px /$base-width) * 100vw; | |
} |
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
// ---- | |
// Sass (v3.4.9) | |
// Compass (v1.0.1) | |
// ---- | |
$media-break: 1024px; | |
@function strip-units($number) { | |
@return $number / ($number * 0 + 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
//Simple default example | |
var _this = this; | |
var message = new Message(); | |
message.setTitle('Login required'); | |
message.setContent('You must be logged in to create an event.<br />Go to settings to sign in with your google account.'); | |
_this.context.messageManager.showMessage(message).then(function(){ | |
//TODO go to settings | |
}, function(){ | |
//TODO reject action |
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
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="loader.css" /> | |
</head> | |
<body> | |
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="ui-loader"> | |
<rect x="0" y="0" width="100" height="100" fill="none" class="bk"></rect> | |
<rect x="46.5" y="40" width="7" height="20" rx="5" ry="5" fill="#00b2ff" transform="rotate(0 50 50) translate(0 -30)"> | |
<animate attributeName="opacity" from="1" to="0" dur="1s" begin="0s" repeatCount="indefinite"/> | |
</rect> |
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 getUser(){ | |
var _this = this; | |
var ajax = new Ajax(); | |
var header = { 'Authorization': this.tokenType+' '+this.accessToken }; | |
ajax.setHeaders(header); | |
return new Promise(function(resolve, reject){ | |
if(_this.userData){ | |
resolve({data: _this.userData}); | |
}else{ | |
ajax.get(_this.userUrl).then(function(res){ |
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
var dbrequest = indexedDB.open("IDBWrapper-storage", 1); | |
var db; | |
dbrequest.onsuccess = function(e) { | |
db = e.target.result; | |
}; | |
function getData(){ | |
var trans = db.transaction(["storage"], "readwrite"); | |
var store = trans.objectStore("storage"); | |
var request = store.get('icomoon'); |
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
[ | |
{ | |
"code":"AS", | |
"name":"Asia", | |
"countries":[ | |
{ | |
"name":"Bangladesh", | |
"code":"BGD", | |
"iso":"BD" | |
}, |