Skip to content

Instantly share code, notes, and snippets.

View mofirouz's full-sized avatar

Mo Firouz mofirouz

View GitHub Profile
@peterhellberg
peterhellberg / graceful.go
Last active November 13, 2024 20:20
*http.Server in Go 1.8 supports graceful shutdown. This is a small example.
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"time"
)
@krzys-h
krzys-h / UnityWebRequestAwaiter.cs
Created July 20, 2018 22:47
[Unity] Use UnityWebRequest with async/await
public class UnityWebRequestAwaiter : INotifyCompletion
{
private UnityWebRequestAsyncOperation asyncOp;
private Action continuation;
public UnityWebRequestAwaiter(UnityWebRequestAsyncOperation asyncOp)
{
this.asyncOp = asyncOp;
asyncOp.completed += OnRequestCompleted;
}
@DazWilkin
DazWilkin / main.go
Last active July 16, 2019 22:29
Google Container Registry client using Docker Distribution
package main
import (
"context"
"flag"
"log"
"github.com/docker/distribution/registry/client"
heroku "github.com/heroku/docker-registry-client/registry"
"github.com/motemen/go-loghttp"