Skip to content

Instantly share code, notes, and snippets.

function all_files_deleted {
local dir=$1 files
readarray -t files < <(git ls-tree HEAD -r --name-only -- "${dir}")
[[ ${#files[@]} -eq 0 ]] && return 0
printf '%s\0' "${files[@]}" | xargs -0 git status --porcelain -- 2>/dev/null | \
awk -v t="${#files[@]}" '/^D/ { ++c } END { exit(c == t ? 0 : 1) }'
}
function ls {
local orig_args=("$@") d_opt=()
local -i argc=0
while [[ $# -gt 0 ]]; do
case $1 in
-[aAbBcCdDfgGhHiklLmnNorRsStuUvxXZ1]|--all|--almost-all|--author|--context|--dereference|--dereference-command-line|--dereference-command-line-symlink-to-dir|--directory|--dired|--file-type|--full-time|--group-directories-first|--help|--hide-control-chars|--human-readable|--ignore-backups|--inode|--kibibytes|--literal|--no-group|--numeric-uid-gid|--quote-name|--recursive|--reverse|--show-control-chars|--size|--version|--zero)
;;
-[ITpw]*|@(--block-size|--format|--hide|--ignore|--indicator-style|--indicator-style|--quoting-style|--sort|--tabsize|--time|--time-style|--width)?(=*))
get_opt_and_optarg_gnu "${@:2}"
diff --git a/src/fe-gtk/notifications/notification-freedesktop.c b/src/fe-gtk/notifications/notification-freedesktop.c
index a23284e5..09b15216 100644
--- a/src/fe-gtk/notifications/notification-freedesktop.c
+++ b/src/fe-gtk/notifications/notification-freedesktop.c
@@ -69,7 +69,7 @@ notification_backend_show (const char *title, const char *text)
g_variant_builder_close (&params);
g_variant_builder_close (&params);
- g_variant_builder_add (&params, "i", -1); /* Expiration */
+ g_variant_builder_add (&params, "i", 20000); /* Expiration */
~ [1]> help
help: Help is being displayed in xdg-open.
~> wineserver: using server-side synchronization.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
0110:fixme:exec:SHELL_execute flags ignored: 0x00000100
wineserver: using server-side synchronization.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
0110:fixme:exec:SHELL_execute flags ignored: 0x00000100
wineserver: using server-side synchronization.
diff --git a/lib/portage/package/ebuild/doebuild.py b/lib/portage/package/ebuild/doebuild.py
index 8b65a78..ea09721 100644
--- a/lib/portage/package/ebuild/doebuild.py
+++ b/lib/portage/package/ebuild/doebuild.py
@@ -1006,6 +1006,10 @@ def doebuild(
)
if mydo in clean_phases:
+ for f in ["keeptemp", "keepwork"]:
+ if f in mysettings.features:
#!/bin/bash
# ------------------------------------------------------------------------------
# git-checkout-last-version
#
# Extracts the last version of a file before it was removed from git
#
# Usage: git-checkout-laster-version[.bash] [options] [--] file
#
#!/bin/bash
# ------------------------------------------------------------------------------
# git-move
#
# Moves commits in a "context" to a new base commit within the same context
#
# The context can be a branch or simply a commit representing itself and the
# chain of commits behind it.
function get_opt_and_optarg_gnu {
local optional=false
if [[ $1 == @optional ]]; then
optional=true
shift
fi
OPT=$1 OPTARG= OPTSHIFT=0
#!/bin/bash
function stopwatch {
local start=${EPOCHREALTIME} diff_i diff_f stop_at= IFS=.
trap 'stop_at=${EPOCHREALTIME}' INT
printf '\r\e[K%s.%06d' 0 0
function stopwatch_get_diff {
set -- $1 $2
diff_i=$(( 10#$3 - 10#$1 ))
// get-default-gsettings-backend.c
// Compilable using 'gcc $(pkgconf --cflags --libs gio-2.0) -o get-default-gsettings-backend{,.c}'
// Author: konsolebox
// Copyright Free / Public Domain
#define G_SETTINGS_ENABLE_BACKEND 1
#include <assert.h>
#include <gio/gio.h>
#include <gio/gsettingsbackend.h>