Skip to content

Instantly share code, notes, and snippets.

@Ajnasz
Ajnasz / README.md
Last active May 19, 2018
Download stuff from humble-bundle in batch
View README.md
View commit-msg
#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to "commit-msg".
@Ajnasz
Ajnasz / background.js
Last active Oct 1, 2017
youtube embed blocker webextension
View background.js
chrome.webRequest.onBeforeRequest.addListener(
function(requestDetails){
console.log('Loading: ' + requestDetails.url);
return { cancel: true };
},
{urls: ['*://www.youtube.com/embed/*']},
['blocking']
);
View toggle-keyboard-layout.sh
#!/bin/sh
set -e
PID_FILE="/tmp/toggle_keyboard_layout.pid"
while [ -f $PID_FILE ];do
exit 0;
done;
@Ajnasz
Ajnasz / fluxbox_init
Created Aug 16, 2017
How to add rootmenu to fluxbox toolbar
View fluxbox_init
session.screen0.toolbar.button.rootmenu.label: rootmenu
session.screen0.toolbar.button.rootmenu.commands: RootMenu
session.screen0.toolbar.tools: button.rootmenu, workspacename, iconbar, systemtray, clock
@Ajnasz
Ajnasz / build.sh
Last active Apr 27, 2020
suckless terminal config
View build.sh
#!/bin/sh
set -e
git co -- .
wget http://st.suckless.org/patches/st-scrollback-20170329-149c0d3.diff
wget http://st.suckless.org/patches/st-scrollback-mouse-20170427-5a10aca.diff
patch < st-scrollback-20170329-149c0d3.diff
View gist:f63be5047b84d5104dd6d8e16f81deb9
module.exports = function (robot) {
robot.hear(/test topic/, function (msg) {
msg.topic('test topic');
});
};
View .tmux.conf
# Set the prefix to ^A.
unbind C-b
set -g prefix C-a
bind a send-prefix
bind-key C-a last-window
bind-key Tab select-pane -D
bind-key k select-pane -U
bind-key j select-pane -D
bind-key h select-pane -L
@Ajnasz
Ajnasz / storage-check.sh
Created Feb 9, 2015
Remount nfs storage
View storage-check.sh
#!/bin/sh
# Remount nfs storage
ls /storage > /dev/null
if [ "$?" -ne "0" ]; then
echo "Error listing /storage" 1>&2
umount /storage
mount /storage
@Ajnasz
Ajnasz / hup-comment-expand.js
Last active Aug 29, 2015
expands comments on click
View hup-comment-expand.js
var comments = document.querySelector('#comments');
function findParentComment(elem) {
while (elem && elem.parentNode) {
if (elem.classList.contains('comment')) {
return elem;
}
elem = elem.parentNode;
}