Skip to content

Instantly share code, notes, and snippets.

View codenoid's full-sized avatar

codenoid

  • Wonogiri, Jawa Tengah
  • 10:52 (UTC +07:00)
View GitHub Profile
@adtac
adtac / Dockerfile
Last active April 13, 2024 22:33
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@win-t
win-t / resource.go
Last active April 12, 2022 02:26
golang owned goroutine
package resource
import (
"context"
"fmt"
"io"
"runtime"
"sync/atomic"
"time"
)
@carolynvs
carolynvs / .gitconfig
Last active October 19, 2022 14:44
git wip - Show what branches you have been working on lately
[alias]
wip = for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads
@codenoid
codenoid / server.go
Last active October 6, 2019 05:48
golang net/http template usage
package main
import (
"fmt"
"net/http"
)
func index(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200)
@mathdroid
mathdroid / vapor.1.gif
Last active January 8, 2021 20:32
Gist for vapor.1.gif. Generated by `crop-github-images-cli`.
vapor.1.gif
@bmaupin
bmaupin / free-database-hosting.md
Last active May 9, 2024 10:08
Free database hosting
package main
import (
"encoding/json"
"fmt"
)
func main() {
b := []byte(`{"key":"value"}`)
package main
import (
"flag"
"log"
"net/http"
"strings"
)
func main() {
@JasonAtNvidia
JasonAtNvidia / txdocker
Last active March 8, 2022 08:15
Short Bash script to enable use of the GPU within a docker container running on an NVIDIA Jetson TX2. Place inside /usr/local/bin/, chmod +x txdocker, ensure it is in your system PATH, and use just as you would the docker command.
#!/bin/bash
#Jason T. 2-6-2018
# Check specifically for the run command
if [[ $# -ge 2 && $1 == "run" ]]; then
# Tell docker to share the following folders with the base system
# This allows the docker containers to find CUDA, cuDNN, TensorRT
LIB_MAPS="/usr/lib/aarch64-linux-gnu \
/usr/local/cuda \
/usr/local/cuda/lib64"
@codenoid
codenoid / gist:5ff5097ad1652a15f6c6076fca97c2ac
Created November 16, 2017 13:02
change_datetime_to_jakarta.txt
sudo mv /etc/localtime /etc/localtime.old
sudo ln -sf /usr/share/zoneinfo/Asia/Jakarta /etc/localtime