Skip to content

Instantly share code, notes, and snippets.

View 0xBADDCAFE's full-sized avatar

shun 0xBADDCAFE

View GitHub Profile
@0xBADDCAFE
0xBADDCAFE / docker-compose.yml
Created January 19, 2022 15:08
docker compose file for spigot server
version: "3.8"
services:
mc:
image: itzg/minecraft-server:java16
ports:
# expose the Minecraft server port outside of container
- 25565:25565
- 8123:8123
environment:
mushroom% sudo du -sh /mnt/wsl
0 /mnt/wsl
mushroom% sudo ls -lR /mnt/wsl
/mnt/wsl:
total 0
drwxr-xr-x 4 root root 100 Jul 5 20:15 docker-desktop
drwxr-xr-x 3 root root 60 Jul 5 20:15 docker-desktop-bind-mounts
drwxr-xr-x 5 root root 100 Jul 5 20:15 docker-desktop-data
/mnt/wsl/docker-desktop:
~$ ls -l $(which docker)
lrwxrwxrwx 1 root root 48 Jul 5 12:12 /usr/bin/docker -> /mnt/wsl/docker-desktop/cli-tools/usr/bin/docker
~$ ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 912 580 ? Sl 12:12 0:00 /init
root 49 0.0 0.0 892 80 ? Ss 12:12 0:00 /init
root 50 0.0 0.0 892 80 ? S 12:12 0:00 /init
shun 51 0.0 0.0 718600 16088 pts/0 Ssl+ 12:12 0:00 docker serve --address unix:///home/shun/.docker/run/docker-cli-ap
root 52 0.0 0.0 0 0 ? Z 12:12 0:00 [init] <defunct>
root 61 0.0 0.0 0 0 ? Z 12:12 0:00 [init] <defunct>
// ==UserScript==
// @name NoAd Timeline
// @namespace http://0xbd.cf/
// @version 0.1
// @description display:none; for Ad
// @author 0xBADDCAFE
// @match https://twitter.com/*
// @grant none
// ==/UserScript==
~
❯ setopt
alwaystoend
autocd
autopushd
autoresume
nobgnice
nocaseglob
cdablevars
noclobber
@0xBADDCAFE
0xBADDCAFE / clipboard_image_uploader.user.js
Last active September 11, 2019 05:46
Upload clipboard image to imgur and paste link
// ==UserScript==
// @name kokoro.io clipboard image uploader
// @namespace http://0xbd.cf/
// @version 0.1
// @description Upload clipboard image to imgur and paste link
// @author You
// @match https://kokoro.io/
// @grant none
// ==/UserScript==
fun confirm() = launch {
val location = requestLocationWithCheck()
location?.let{
send(it)
}
fragmentManager.beginTransaction()
.replace(R.id.container, MyFragment.newInstance())
.commit()
}
import android.content.pm.PackageManager
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
val runWithCheck: MutableMap<Int, (Boolean) -> Unit> = mutableMapOf()
suspend fun Fragment.withCheck(vararg requests: String, run: (() -> Unit)? = null) = suspendCoroutine<Boolean> { cont ->
val isGranted = requests.map {
import androidx.annotation.StringRes
import androidx.appcompat.app.AlertDialog
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
class SuspensiveAlertDialogBuilder(val builder: AlertDialog.Builder) {
@StringRes
var positiveTextId: Int? = null
var positiveText: String? = null
@StringRes
diff -ura byobu-5.127/usr/share/byobu/profiles/tmux byobu-5.127-2/usr/share/byobu/profiles/tmux
--- byobu-5.127/usr/share/byobu/profiles/tmux 2018-08-13 00:52:36.000000000 +0900
+++ byobu-5.127-2/usr/share/byobu/profiles/tmux 2019-05-03 22:41:21.990907600 +0900
@@ -39,9 +39,13 @@
#set-option -g set-titles on
#set-option -g set-titles-string '#(whoami)@#H - byobu (#S)'
-set-option -g pane-active-border-bg $BYOBU_HIGHLIGHT
-set-option -g pane-active-border-fg $BYOBU_HIGHLIGHT
-set-option -g pane-border-fg $BYOBU_ACCENT