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
function applyMotionBlur(actor, n, dir, wFn=function() { return 1; }) { | |
function blurShaderSource() { | |
function SAMPLE(offx, offy, w) { | |
return `pixel += ${w} * texture2D (tex, cogl_tex_coord_in[0].st + vec2(width_inv, height_inv) * vec2 (${offx}, ${offy}));` | |
} | |
function motionBlur(n, sign=1) { | |
let vs = [] | |
let weights = [] | |
let sum = 0 |
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
--- Firefox places.sqlite exploration | |
-- https://developer.mozilla.org/en-US/docs/Mozilla/Tech/Places/Database | |
-- https://wiki.mozilla.org/images/d/d5/Places.sqlite.schema3.pdf | |
-- http://forensicswiki.org/wiki/Mozilla_Firefox_3_History_File_Format (probably somewhat outdated) | |
-- [select text -> right click -> search] does not set from_visit :( | |
-- Gotchas :angry-face: https://superuser.com/a/1405880/153095 (Explains why your history is incomplete) |
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
-- Author: Ole Jørgen Brønner ([email protected]) | |
-- Requirement: xclip | |
-- Installation: | |
-- 'mkdir -p ~/.config/mpv/scripts && cp -i copy-permalink.lua ~/.config/mpv/scripts' | |
function copyPermalink() | |
local pos = mp.get_property_number("time-pos") | |
local uri = mp.get_property("path") | |
-- %q might not be fully robust | |
local bookmark = string.format("mpv --start=%s %q", pos, uri) |
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
#!/usr/bin/env zsh | |
## man dconf-editor: | |
# | |
# > dconf-editor reads gsettings schemas from $XDG_DATA_DIRS/glib-2.0/schemas | |
# > to obtain descriptions, default values and allowed values for keys. | |
# | |
# It only reads compiled schemas and only look for a single file - | |
# 'gschemas.compiled' per XDG_DATA_DIR though.. (??) | |
# |
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
#compdef copyq | |
#autoload | |
typeset -A cmds | |
cmds=( | |
show 'show main window and optionally open tab with given name' | |
hide 'hide main window' | |
toggle 'show or hide main window' | |
menu 'open context menu' |
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
# Make the autosuggestion a completion value | |
function _autosuggest_complete() { | |
local -a candidates | |
# IMPROVEMENT: If we can be sure that autosuggest has already run we can | |
# just grab the suggestion variable, avoiding the double call | |
local orignal_ZSH_AUTOSUGGEST_USE_ASYNC=$ZSH_AUTOSUGGEST_USE_ASYNC | |
ZSH_AUTOSUGGEST_USE_ASYNC=0 # need the result immediately | |
_zsh_autosuggest_strategy_$ZSH_AUTOSUGGEST_STRATEGY "$BUFFER" | |
ZSH_AUTOSUGGEST_USE_ASYNC=$orignal_ZSH_AUTOSUGGEST_USE_ASYNC |
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
#!/bin/bash -e | |
function merge_repo_to_subdir { | |
local url=$1 | |
local commit=$2 | |
local module_path=$3 | |
if [[ -z $url || -z $commit || -z $module_path ]]; then | |
echo "Usage: merge-repo-to-subdir.sh URL BRANCH PATH" >&2 | |
exit 1 |
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
#!/bin/usr/env bash | |
# Originaly from: https://www.reddit.com/r/NixOS/comments/5yxt45/simple_nix_package_search/ | |
nq () { | |
local CACHE="$HOME/.cache/nq-cache" | |
if ! ( [ -e $CACHE ] && [ $(stat -c %Y $CACHE) -gt $(( $(date +%s) - 3600*24*7 )) ] ); then | |
# read gotcha.. can't pipe to read (as usual zsh beats bash) | |
read x MEM_AVAIL_KB UNIT < <(grep MemAvailable: /proc/meminfo) | |
if [[ $UNIT != "kB" || $MEM_AVAIL_KB -lt 1000000 ]]; then | |
# nix-env can easily use up to 1GB during -qa |
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
#!/usr/bin/env bash | |
# This is free and unencumbered software released into the public domain. | |
# Anyone is free to copy, modify, publish, use, compile, sell, or | |
# distribute this software, either in source code form or as a compiled | |
# binary, for any purpose, commercial or non-commercial, and by any | |
# means. | |
# In jurisdictions that recognize copyright laws, the author or authors | |
# of this software dedicate any and all copyright interest in the |
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
(defun nix-shell-c-system-header-paths () | |
"Extract header search paths from the NIX_CFLAGS_COMPILE env variable" | |
(cl-labels ((every-other (li &optional pick) | |
(when li | |
(if pick | |
(cons (car li) (every-other (cdr li))) | |
(every-other (cdr li) (not pick)))) | |
)) | |
(let* ((cflags (getenv "NIX_CFLAGS_COMPILE"))) |