Skip to content

Instantly share code, notes, and snippets.

View Abirdcfly's full-sized avatar
😶

Abirdcfly

😶
View GitHub Profile
@honmaple
honmaple / yabai.lua
Created March 25, 2024 10:27
Like i3wm's scratchpad
local _M = {
scratchpad = {}
}
local yabai = string.gsub(hs.execute("which yabai", true), "%s+", "")
_M.init = function()
local output, status = _M.exec("query --windows")
if not status then return end
@zhuowei
zhuowei / Ensemble.plist
Last active September 18, 2023 06:26
Put this file as /Library/Preferences/FeatureFlags/Domain/Ensemble.plist and reboot to (hopefully) turn on Universal Control on macOS 12
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- not sure which one it is, so set both -->
<key>Ensemble</key>
<dict>
<key>Enabled</key>
<true/>
</dict>
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active May 6, 2024 14:11
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@luk6xff
luk6xff / ARMonQEMUforDebianUbuntu.md
Last active April 23, 2024 17:11 — forked from bruce30262/ARMDebianUbuntu.md
Emulating ARM with QEMU on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

If there's no qemu-arm-static in the package list, install qemu-user-static instead

@Rand01ph
Rand01ph / geektime.user.js
Created September 4, 2018 08:41
让极客时间的内容可以复制
// ==UserScript==
// @name geektime copy
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 让极客时间的内容可以复制!
// @author Rand01ph
// @match https://time.geekbang.org/column/*
// @grant none
// @require http://cdn.staticfile.org/jquery/2.1.1/jquery.min.js
// ==/UserScript==
@cwgem
cwgem / build_guide.md
Last active March 31, 2024 20:10
Building `dockerd` and `docker-cli` from source

Introduction

This guide looks at what it will take to build dockerd and docker-cli from source with Ubuntu. Ubuntu was chosen as the OS as it uses the same apt-get calls the standard Dockerfile method uses making the experience a bit more seamless. While the official method is building docker in a container, here are some reasons why you may want to build this way:

  • Custom source modifications for testing
  • System that does not yet have a docker(d) binary release
  • You want to test things on a non-standard toolchain
  • You just want to deep dive

As you can probably tell using this method means you're delving away from support. Please don't file issues/PRs unless you can reproduce in the official build environment. In fact unless you really have one of the strong needs above you're better off building off a container since this guide is mostly a lot of copy/paste from the Dockerfile used in the official build system.

@wonderbeyond
wonderbeyond / drag-drop-sort-design-implementation.md
Last active April 4, 2023 04:34
Drag-drop sort: Design & Implementation
@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 24, 2024 06:51
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@wuriyanto48
wuriyanto48 / golang_reduce_map.go
Last active December 11, 2022 18:04
How to Join Map In Golang (Map Union)
package main
import (
"fmt"
)
type Item struct{
Id int
Name string
Qty int
@mdonkers
mdonkers / server.py
Last active May 6, 2024 23:32
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer