This file contains 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
data class Person(val firstName: String, var age: Int) { | |
// ... | |
} |
This file contains 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
{ | |
"name": "This is the name of the user", | |
"name": "Romain Pouclet", | |
"email": "This is the email of the user, blablabla doc", | |
"email": "[email protected]" | |
} |
This file contains 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
{ | |
"name": "Skin Tone 0", | |
"swatches": [ | |
{ | |
"hue": 0.1041666666666669, | |
"saturation": 0.03225806451612903, | |
"brightness": 0.9725490196078431, | |
"alpha": 1, | |
"colorSpace": 0 | |
}, |
This file contains 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
% warning = "This file was automatically generated and should not be edited." | |
// ${warning} | |
%{ | |
import glob | |
import os | |
import re | |
}% | |
struct FixtureFile { |
This file contains 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 os.log | |
final class Searcher { | |
struct Result: Equatable { | |
let count: Int | |
let hasMore: Bool | |
} |
This file contains 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 { message, warn, danger, markdown } from "danger" | |
export default async () => { | |
const issue = danger.github.issue; | |
console.log('Dealing with an issue here', { issue }); | |
message("Hi!"); | |
warn('Uh-oh, that is not good'); | |
markdown('# This does not work, does it?'); | |
} |
This file contains 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
// This is a generic filter | |
typealias Filter<T> = (T) -> Bool | |
// This is a simplified entry | |
struct Entry { | |
let title: String | |
} | |
// This is a tiny helper function that returns a filter | |
// that takes an entry and checks if the title starts with the |
This file contains 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 Cocoa | |
precedencegroup ForwardApplication { | |
associativity: left | |
} | |
precedencegroup ForwardComposition { | |
associativity: left | |
higherThan: ForwardApplication | |
} |
This file contains 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 Sequence { | |
func groupBy<K: Hashable>(_ kp: KeyPath<Iterator.Element, K>) -> [K: [Iterator.Element]] { | |
// Creating the resulting dictionary | |
return reduce([:]) { grouped, item in | |
let key = item[keyPath: kp] | |
var copy = grouped | |
if copy[key] == nil { | |
copy[key] = [] | |
} |
NewerOlder