All of the following information is based on go version go1.17.1 darwin/amd64.
| GOOS | Out of the Box |
|---|---|
aix |
✅ |
android |
✅ |
| #!/bin/bash | |
| # Get Branch Name | |
| branch_name=$(git rev-parse --abbrev-ref HEAD) | |
| # Filter Running Actions | |
| run_line=$(gh run list | grep "$branch_name" | grep "in_progress" | head -n 1) | |
| if [ -z "$run_line" ]; then | |
| echo "No active GH action run found for the current branch" |
| secrets/ |
| infix fun <T,O>List<T>.cartesianProduct(others:List<O>):List<Pair<T,O>> = | |
| flatMap{ t:T-> | |
| others.map { o-> Pair(t,o) } | |
| } | |
| inline fun <T, O, R> List<T>.mapCartesianProduct(others: List<O>, transform: (Pair<T, O>) -> R): List<R> = | |
| flatMap { t: T -> | |
| others.map { o -> transform(Pair(t, o)) } | |
| } |
| https://youtu.be/-C-JoyNuQJs?t=39m45s | |
| When I put the reference implementation onto the website I needed to | |
| put a software license on it. | |
| And I looked at all the licenses that were available, and there were a lot | |
| of them. And I decided that the one I liked the best was the MIT License, | |
| which was a notice that you would put on your source and it would say, | |
| "you're allowed to use this for any purpose you want, just leave the | |
| notice in the source and don't sue me." |
| import com.sun.net.httpserver.HttpServer | |
| import java.io.PrintWriter | |
| import java.net.InetSocketAddress | |
| /** | |
| * Minimal embedded HTTP server in Kotlin using Java built in HttpServer | |
| */ | |
| fun main(args: Array<String>) { | |
| HttpServer.create(InetSocketAddress(8080), 0).apply { |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
| package log | |
| import ( | |
| "fmt" | |
| "github.com/Sirupsen/logrus" | |
| "runtime" | |
| "strings" | |
| ) | |
| var logger = logrus.New() |
| import Foundation | |
| // MARK: - Comparable | |
| extension NSDecimalNumber: Comparable {} | |
| public func ==(lhs: NSDecimalNumber, rhs: NSDecimalNumber) -> Bool { | |
| return lhs.compare(rhs) == .OrderedSame | |
| } |
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| # | |
| # Copyright 2007 Google Inc. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # |