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 http = require('http'); | |
| http.createServer(function (req, res) { | |
| res.writeHead(200, {'Content-Type': 'text/plain'}); | |
| res.end('Hello World\n'); | |
| }).listen(8080); | |
| console.log('Server running.'); |
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
| start | |
| = yarr* | |
| yarr | |
| = __ docComment:docComment __ { | |
| return docComment | |
| } | |
| docComment | |
| = comment:comment lineTerminator styles:styles* __ orphanStyles* { |
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
| #define UIColorFromRGBA(rgbaValue) [UIColor colorWithRed:((float)((rgbaValue & 0xFF0000) >> 16)) / 255.0 \ | |
| green:((float)((rgbaValue & 0xFF00) >> 8)) / 255.0 \ | |
| blue:((float)(rgbaValue & 0xFF)) / 255.0 \ | |
| alpha:((float)((rgbaValue & 0xFF000000) >> 24)) / 255.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
| NSString *hexString = [NSString stringWithFormat:@"0x%02x%02x%02x%02x", alpha, red, green, blue]; // Will output 0x00000000 to 0xFFFFFFFF |
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 <#Class#>ViewController; | |
| @protocol <#Class#>ViewControllerDelegate <NSObject> | |
| - (void)<#class#>ViewControllerDidCancel:(<#Class#>ViewController *)controller; | |
| @end | |
| // Interface |
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 Foundation | |
| infix operator >=>: MonadPrecedenceRight | |
| infix operator =>=: MonadPrecedenceRight | |
| infix operator =>>: MonadPrecedenceRight | |
| infix operator <^>: ApplicativePrecedence | |
| infix operator <*>: ApplicativePrecedence | |
| precedencegroup ApplicativePrecedence { | |
| associativity: 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
| struct SuperEllipse { | |
| static func superEllipse(forRect rect: CGRect, topRightCornerRadius trcr: CGFloat, bottomRightCornerRadius brcr: CGFloat, bottomLeftCornerRadius blcr: CGFloat, topLeftCornerRadius tlcr: CGFloat) -> UIBezierPath { | |
| let trcr = 1.2 * trcr | |
| let brcr = 1.2 * brcr | |
| let blcr = 1.2 * blcr | |
| let tlcr = 1.2 * tlcr | |
| let path = UIBezierPath() | |
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
| expr -l Swift -- import UIKit | |
| expr -l Swift -- unsafeBitCast(0x6000001d6350, to: UIView.self).backgroundColor = UIColor.red |
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
| // Get notified of changes to the uid (logged in user). | |
| let cancellable = FirebaseUserPublisher() | |
| .map(\.?.uid) | |
| .removeDuplicates() | |
| .sink { userId in | |
| guard let user = userId else { | |
| // No user | |
| return | |
| } | |
| print(userId) |
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
| @AppStorage("saved_array") var savedArray = ArrayTypeToSave() | |
| savedArray = ["Hello", "World"] |
OlderNewer