Skip to content

Instantly share code, notes, and snippets.

@1ace
1ace / keybase.md
Created March 2, 2014 18:37
Keybase.io proof of ownership for this GitHub account.

Keybase proof

I hereby claim:

  • I am 1ace on github.
  • I am 1ace (https://keybase.io/1ace) on keybase.
  • I have a public key whose fingerprint is CC31 EF29 D32A 6637 8895 30F2 481D 0E9D 964E 5593

To claim this, I am signing this object:

@1ace
1ace / snail
Created May 11, 2014 02:27
Sometimes I get bored at 4am…
#!/usr/bin/env sh
anim=('_@"' '_@-"')
trail='.'
COLUMNS=$(tput cols)
for i in $(seq 1 $COLUMNS)
do
line=""
for j in $(seq 1 $i)
@1ace
1ace / dropbox-cli-shell.patch
Created March 3, 2015 07:36
Patch for https://linux.dropbox.com/packages/dropbox.py making `dropbox running` compatible with a shell
--- dropbox.py 2015-03-03 08:33:27.509681479 +0100
+++ dropbox.py 2015-03-03 08:34:11.816959170 +0100
@@ -1054,9 +1054,9 @@
u"""return whether dropbox is running
dropbox running
-Returns 1 if running 0 if not running.
+Returns 0 if running 1 if not running.
"""
- return int(is_dropbox_running())
@1ace
1ace / timestamp.cpp
Created May 19, 2015 14:51
Unix timestamp with microsecond precision
#include <chrono> // std::chrono::high_resolution_clock, std::chrono::duration
#include <iostream> // std::cout
#include <iomanip> // std::fixed
int main() {
auto now = std::chrono::high_resolution_clock::now();
auto timestamp = std::chrono::duration<double>(now.time_since_epoch()).count();
std::cout << std::fixed << timestamp << std::endl;
}
diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build
index 36adde4c48c1c800b5c1..5a55b798bb0227af90dc 100644
--- a/src/mapi/es1api/meson.build
+++ b/src/mapi/es1api/meson.build
@@ -21,7 +21,7 @@
es1_glapi_mapi_tmp_h = custom_target(
'es1_glapi_mapi_tmp.h',
input : [mapi_abi_py, gl_and_es_api_files],
- output : 'glapi_mapi_tmp.h',
+ output : 'es1_glapi_mapi_tmp.h',
#!/usr/bin/env bash
set -eu -o pipefail
declare -r drm_fourcc_h=/usr/include/libdrm/drm_fourcc.h
declare -r prog="${BASH_SOURCE[0]}".out
update() {
fourcc_h=$(perl -pe 's/\\\n//' < "$drm_fourcc_h")
fourcc_code=($(echo "$fourcc_h" | grep -E '#define\s+\w+\s+fourcc_code' | awk '{print $2}'))
fourcc_mod_code=($(echo "$fourcc_h" | grep -E '#define\s+\w+\s+fourcc_mod_code' | awk '{print $2}'))
@1ace
1ace / cd.sh
Created November 3, 2019 21:55
cd() {
if [ $# -gt 1 ]; then
echo "cd: too many arguments" >&2
return 1
fi
if [ -d "$1" ]; then
pushd "$1"
elif [ "$1" == "-" ]; then
popd
#!/usr/bin/env bash
set -eu -o pipefail
if [ -z "${WAYLAND_DISPLAY:-}" ]
then
echo >&2 "This script only supports Wayland compositors"
exit 1
fi
for tool in swaymsg jq sed slurp grim notify-send wl-copy