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 XCTest | |
| class GenericThing<T: Equatable> { | |
| func foo(t: T) { | |
| NSLog("foo \(t)") | |
| } | |
| } | |
| func genericFunc<T: Equatable>(left: T, right: T) { | |
| NSLog("\(left) == \(right) ?: \(left == right)") |
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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>IE Compatibility Test</title> | |
| </head> | |
| <body> | |
| <h1 id="test-h1"></h1> |
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 | |
| // OK: | |
| var test: ([Int : Int], Int) -> [Int : Int] = { (x, y) in x } | |
| // CRASH: | |
| //var test2: ([Int : Int], Int) -> [Int : Int] = { (var x, y) in x } |
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 | |
| public class BaseClass<H> { | |
| public init?() { | |
| } | |
| } |
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 | |
| termsize() { | |
| echo -ne "\033[8;${1};${2}t" | |
| } | |
| asciicast=$1 | |
| orig_height=0 | |
| orig_width=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
| // Setup | |
| var tracklistObj = {}, | |
| currentPlaylist, | |
| checkIntervalTime = 100, | |
| lastTime; | |
| // Process the visible tracks | |
| function getVisibleTracks() { | |
| var playlist = document.querySelectorAll('.song-table tr.song-row'); | |
| for(var i = 0; i < playlist.length ; i++) { |
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 | |
| let data = """ | |
| -1 | |
| 1 | |
| """ | |
| var visitedFrequencies = Set<Int>() | |
| let parsedData = data.components(separatedBy: "\n").map{ Int($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
| #!/bin/sh | |
| # Shamelessly stolen from https://github.com/neonichu/Core-Audio-Samples/blob/master/Samples/extract-sf2.sh | |
| # | |
| ## Convert a SoundFont + MIDI file to a CAF audio file. | |
| ## | |
| ## needs: | |
| ## fluidsynth, sox (installable via brew) | |
| ## afconvert (part of OS X) |
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
| decode_pinyin = function(pinyin) { | |
| const core = ["a", "e", "i", "o", "u", "ü"] | |
| let arr = pinyin.replace(/<b>|<\/b>|<div>|<\/div>/g, "").split("") | |
| is_core = function(c, c_previous_two = "", c_next = "") { | |
| //pre conditions | |
| if(c == "r" && (c_next == " " || c_next == "") && (c_previous_two != " " && c_previous_two != "")) { | |
| return [true, true] | |
| } |
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
| . |
OlderNewer