Skip to content

Instantly share code, notes, and snippets.

View toVersus's full-sized avatar

Tsubasa Nagasawa toVersus

View GitHub Profile
@toVersus
toVersus / gke-image-streaming.md
Last active August 3, 2023 14:28
GKE Image Streaming
diff --git a/vendor/github.com/google/go-containerregistry/pkg/authn/k8schain/k8schain.go b/vendor/github.com/google/go-containerregistry/pkg/authn/k8schain/k8schain.go
index d90ac4d1..36fb28a9 100644
--- a/vendor/github.com/google/go-containerregistry/pkg/authn/k8schain/k8schain.go
+++ b/vendor/github.com/google/go-containerregistry/pkg/authn/k8schain/k8schain.go
@@ -130,11 +130,14 @@ func NewNoClient() (authn.Keychain, error) {
return New(nil, Options{})
}
-type lazyProvider credentialprovider.LazyAuthConfiguration
+type lazyProvider struct {
@toVersus
toVersus / concat-string.rs
Created July 7, 2018 01:15
concat two strings using raw poitners
extern crate nix;
use std::ffi::CString;
use std::ptr::write;
use nix::libc::{free, malloc, strlen};
fn main() {
let c_str1 = CString::new("Hello, ").unwrap();
let c_str2 = CString::new("world!").unwrap();
@toVersus
toVersus / find_maximum.go
Created May 16, 2018 13:58
Find maximum element of slice in the specified range
package main
import "fmt"
func main() {
a := []int{5, 3, 3, 4, 5}
fmt.Println(findMaximum(a, 0, 4))
}
func findMaximum(A []int, left, right int) int {
package main
// Hamming weight algorithm
// https://en.wikipedia.org/wiki/Hamming_weight
const m1 = 0x5555555555555555
const m2 = 0x3333333333333333
const m4 = 0x0f0f0f0f0f0f0f0f
const h01 = 0x0101010101010101
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)