Table of Contents

1. weechat ignore all join/leave messages

https://weechat.org/files/doc/devel/weechat_faq.en.html#filter_irc_join_part_quit With smart filter (keep join/part/quit from users who spoke recently):

/set irc.look.smart_filter on
/filter add irc_smart * irc_smart_filter *

With a global filter (hide all join/part/quit):

/filter add joinquit * irc_join,irc_part,irc_quit *

2. linux > remove margins on every pdf in the directory

IFS=$'\n'; for f in $(find . -iname '*pdf'); do briss "$f"; done

3. tmux > byobu > weechat scrolling

Alt-F12 enables mouse mode in byobu Alt-m enables mouse mode in weechat Viola- now scrolling works

4. sh > wget > mirror

/usr/bin/wget –no-parent –recursive -l 2 –convert-links –page-requisites –adjust-extension –mirror $URLTOMIRROR

5. php > PDO > set default fetch style   php

https://stackoverflow.com/questions/3893858/is-is-possible-to-set-a-default-pdo-fetch-mode

$connection = new PDO($connection_string);
$connection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
include "db-config.php"; 
include "log.php";

try {
  $DB_CONN = new PDO($DSN, $DB_USERNAME, $DB_PASSWORD);
  $DB_CONN->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE,
                            PDO::FETCH_KEY_PAIR);
} catch (PDOException $e) {
  append_log('I cannot connect to the database because: ' . $e->getMessage());
}

try {
  $DB_CONN->prepare("CREATE TABLE IF NOT EXISTS post (id INT NOT NULL PRIMARY KEY, content TEXT NOT NULL);")->execute();

} catch (PDOException $e) {
  append_log('I cannot create a `post` table because: ' . $e->getMessage());
}

if($_REQUEST["message"]) {
  $DB_CONN->prepare("INSERT INTO post (content) VALUES (?)")->execute([$_REQUEST["message"]]);
}

echo "<pre>" . print_r($DB_CONN->query("SELECT * FROM post;")->fetchAll(), 2) . "</pre>";

6. emacs > cycle through kill ring

A simple 'C-y' ('yank') command inserts the first item from the kill ring into the current buffer. If the 'C-y' command is followed immediately by 'M-y', the first element is replaced by the second element.

7. linux > xorg enable sticky modifier keys