kubectl api-resources --verbs=list -o name | xargs -n 1 -t kubectl get --ignore-not-found --all-namespaces
View Dockerfile
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
# Copies the file into the directory (both are equivalent): | |
COPY some_file /some_directory/ | |
COPY some_file /some_directory/some_file | |
# Copies both files into the directory: | |
COPY some_file another_file /some_directory/ | |
# Copies the contents of the directory (but not the directory itself) into the other directory: | |
COPY some_directory /other_directory/ |
View SimpleCountDownTimer.java
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
package foo; | |
import android.os.CountDownTimer; | |
public class SimpleCountDownTimer { | |
boolean repeat; | |
Runnable action; | |
CountDownTimer c; |
View BleStateMachine.java
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
package com.example.android.app; | |
import android.app.Activity; | |
import android.bluetooth.BluetoothAdapter; | |
import android.bluetooth.BluetoothDevice; | |
import android.bluetooth.BluetoothGatt; | |
import android.bluetooth.BluetoothGattCallback; | |
import android.bluetooth.BluetoothGattCharacteristic; | |
import android.bluetooth.BluetoothGattService; | |
import android.bluetooth.BluetoothProfile; |
View logrus.go
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
// The state of Go logging libraries is disheartening... | |
import ( | |
"github.com/mattn/go-colorable" // not ansicolor because github.com/mgutz/ansi recommends colorable | |
log "github.com/sirupsen/logrus" | |
"github.com/x-cray/logrus-prefixed-formatter" | |
"golang.org/x/crypto/ssh/terminal" | |
"os" | |
) |
View tgit_dmerge.txt
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
"C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe" -m -t1=%yname -t2=%bname -t3=%tname -result=%merged %mine %base %theirs |
View get_all_kubernetes_resources.md
View model_vs_sync.md
Vue.js:
v-model
vs. v-bind:<propname>.sync
Vue.js: These examples use the expression foo
as the data source in the parent.
Prop name | Event name | |
---|---|---|
v-model="foo" |
value by default |
input by default |
v-bind:<propname>.sync="foo" |
arbitrary | update:<propname> |
v-model
View latest_gitlab_artifacts.txt
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
# ZIP: | |
wget --header="PRIVATE-TOKEN: $GITLAB_TOKEN" "https://<gitlab>/<group>/<project>/builds/artifacts/master/download?job=<jobname>" | |
or | |
wget --header="PRIVATE-TOKEN: $GITLAB_TOKEN" "https://<gitlab>/<group>/<project>/-/jobs/artifacts/master/download?job=<jobname>" | |
# Single file: | |
wget -O /path/to/file --header="PRIVATE-TOKEN: $GITLAB_TOKEN" "https://<gitlab>/<group>/<project>/builds/artifacts/master/raw/<filename>?job=<jobname>" |
View go_release_build.txt
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
go build -gcflags=all=-trimpath=c:\path\to\trim -asmflags=all=-trimpath=c:\path\to\trim -ldflags=all="-s -w" | |
upx ... |
View exedir.go
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
var exeDir = getExeDir() | |
func getExeDir() string { | |
if os.Getenv("EXEDIR") != "" { | |
return os.Getenv("EXEDIR") | |
} else { | |
return filepath.Dir(os.Args[0]) | |
} | |
} |
NewerOlder