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 ClassA { | |
| } | |
| let ClassARef: ClassA.Type = ClassA.self | |
| let a = ClassARef.init() | |
| a is ClassA // true | |
| let ClassARef2: ClassA.Type = b.dynamicType |
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
| struct Entity { | |
| let name: String | |
| let age: Int | |
| } | |
| enum SortResult { | |
| case LeftFirst | |
| case RightFirst | |
| case Same | |
| } |
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
| vim -E -s $1 <<-EOF | |
| :set expandtab | |
| :set shiftwidth=2 | |
| :set tabstop=2 | |
| :set softtabstop=2 | |
| normal ggVG= | |
| :wq | |
| EOF |
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
| // | |
| // NSString+HTML.m | |
| // MWFeedParser | |
| // | |
| // Copyright (c) 2010 Michael Waterfall | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
| module.exports = { | |
| // Modern | |
| // | |
| bs_chrome_osx: { | |
| base: 'BrowserStack', | |
| os: 'OS X', | |
| os_version: 'Yosemite', | |
| browser: 'chrome', | |
| browser_version: '39.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
| var my_element = document.getElementById('my-element'); | |
| //-- Returns true/false | |
| my_element.isVisible(my_element); |
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
| //: Playground - noun: a place where people can play | |
| import Foundation | |
| import UIKit | |
| import XCPlayground | |
| class DLLabel: UILabel { | |
| let textContainer = NSTextContainer() | |
| let layoutManager = NSLayoutManager() |
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
| 'use strict'; | |
| function collectForm(form) { | |
| var q = {}; | |
| var i; | |
| var j; | |
| if (!form || form.nodeName !== 'FORM') { | |
| return null; | |
| } |
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 Bluebird = require('bluebird'); | |
| function Something() { | |
| this.queue = []; | |
| this.currentJob = null; | |
| } | |
| Something.prototype.queueJob = function (job) { | |
| if (this.currentJob) { | |
| this.queue.push(job); |