-- https://news.ycombinator.com/item?id=11396045
SELECT count(*)
FROM (SELECT id, repo_name, path
FROM [bigquery-public-data:github_repos.sample_files]
) AS F
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
| #!/bin/bash | |
| ## Copyright (C) 2015 Cerebral Gardens http://www.cerebralgardens.com/ | |
| ## | |
| ## 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 copies of the Software, and to | |
| ## permit persons to whom the Software is furnished to do so, subject to the following | |
| ## conditions: |
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
| Shader "Custom/Curved" { | |
| Properties { | |
| _MainTex ("Base (RGB)", 2D) = "white" {} | |
| _QOffset ("Offset", Vector) = (0,0,0,0) | |
| _Dist ("Distance", Float) = 100.0 | |
| } | |
| SubShader { | |
| Tags { "RenderType"="Opaque" } | |
| Pass | |
| { |
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 | |
| import XCPlayground | |
| XCPSetExecutionShouldContinueIndefinitely() | |
| func getAllEmojis(completion: String? -> ()) { | |
| let url = NSURL(string: "http://www.unicode.org/Public/UCD/latest/ucd/EmojiSources.txt")! | |
| NSURLSession.sharedSession().dataTaskWithURL(url) { data, response, error in | |
| guard let data = data where error == nil else { | |
| completion(nil) |
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 CMDeviceMotion { | |
| func gaze(atOrientation orientation: UIInterfaceOrientation) -> SCNVector4 { | |
| let attitude = self.attitude.quaternion | |
| let aq = GLKQuaternionMake(Float(attitude.x), Float(attitude.y), Float(attitude.z), Float(attitude.w)) | |
| let final: SCNVector4 | |
| switch orientation { |
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
| // TextView subclass that replicates TVOS movies app | |
| // Also made a quick presentation controller | |
| // Just connect the delegate to the ViewController in IB | |
| // and set the TextView class to FocusTextView | |
| import UIKit | |
| class TextPresentationViewController:UIViewController { | |
| let label = UILabel() | |
| let blurStyle = UIBlurEffectStyle.Dark |
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
| /* | |
| * Credit to JC https://github.com/kharmabum for most of this code. | |
| * | |
| * Frameworks used: | |
| * - Alamofire https://github.com/Alamofire/Alamofire | |
| * - Async https://github.com/duemunk/Async | |
| * - AWS SDK http://aws.amazon.com/mobile/sdk/ | |
| */ | |
| import Foundation |
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 CGFloat { | |
| func radians() -> CGFloat { | |
| let b = CGFloat(M_PI) * (self/180) | |
| return b | |
| } | |
| } | |
| extension UIBezierPath { | |
| convenience init(circleSegmentCenter center:CGPoint, radius:CGFloat, startAngle:CGFloat, endAngle:CGFloat) | |
| { |
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
| //================================================================== | |
| /// <#Insert description of new class here#> | |
| class <#NewClassName#> | |
| { | |
| public: | |
| // | |
| // Essentials | |
| // |
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 AppKit | |
| public extension NSBezierPath { | |
| public var CGPath: CGPath { | |
| let path = CGMutablePath() | |
| var points = [CGPoint](repeating: .zero, count: 3) | |
| for i in 0 ..< self.elementCount { | |
| let type = self.element(at: i, associatedPoints: &points) | |
| switch type { |