Skip to content

Instantly share code, notes, and snippets.

View gilbertw1's full-sized avatar

Bryan Gilbert gilbertw1

View GitHub Profile
@gilbertw1
gilbertw1 / conifg.py
Last active October 12, 2017 21:38
Externally edit text field in qutebrowser
c.aliases['edit-field'] = 'debug-pyeval -q objreg.get(\'tabbed-browser\', scope=\'window\', window=\'last-focused\').currentWidget()._widget.page().runJavaScript(\'document.activeElement.value\', lambda res: objreg.get(\'command-dispatcher\', scope=\'window\', window=\'last-focused\')._run_userscript(\'edit_field\', res, verbose=False))'
# Indented Command Python
objreg.get('tabbed-browser', scope='window', window='last-focused') \
.currentWidget()._widget.page() \
.runJavaScript('document.activeElement.value', lambda res:
objreg.get('command-dispatcher', scope='window', window='last-focused') \
._run_userscript('edit_field', res, verbose=False))
@gilbertw1
gilbertw1 / preview
Last active October 23, 2017 15:53
Awesome rg search
#!/bin/sh
FILE_LINE_NO="$1"
FILE="$(echo "$FILE_LINE_NO" | cut -d":" -f1)"
SUFFIX="$(echo $FILE | cut -d"." -f2)"
LINE_NO="$(echo "$FILE_LINE_NO" | cut -d":" -f2)"
if [ "$LINE_NO" -gt 10 ]
then
START="$((${LINE_NO} - 10))"
(defun counsel-projectile-bookmark ()
"Forward to `bookmark-jump' or `bookmark-set' if bookmark doesn't exist."
(interactive)
(require 'bookmark)
(let ((projectile-bookmarks (projectile-bookmarks)))
(ivy-read "Create or jump to bookmark: "
projectile-bookmarks
:action (lambda (x)
(cond ((and counsel-bookmark-avoid-dired
(member x projectile-bookmarks)
@gilbertw1
gilbertw1 / error.txt
Created October 10, 2018 15:23
Arch Linux Servo OpenSSL Error
$ OPENSSL_INCLUDE_DIR=/usr/include/openssl-1.0 OPENSSL_LIB_DIR=/usr/lib/openssl-1.0 ./mach build -d master✱ λ borealis
Compiling servo v0.0.1 (/home/gilbertw1/projects/opensource/servo/ports/servo)
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/gilbertw1/.rustup/toolchains/nightly-2018-10-05-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/gilbertw1/projects/opensource/servo/target/debug/deps/servo-7608be91cbd3c0a9.1004l5ycnbtbr5lb.rcgu.o" "/home/gilbertw1/projects/opensource/servo/target/debug/deps/servo-7608be91cbd3c0a9.13c0a8jtt9kk6ydp.rcgu.o" "/home/gilbertw1/projects/opensource/servo/target/debug/deps/servo-7608be91cbd3c0a9.154a4qp4q1ijjeo8.rcgu.o" "/home/gilbertw1/projects/opensource/servo/target/debug/deps/servo-7608be91cbd3c0a9.15q6054mg4j93jqb.rcgu.o" "/home/gilbertw1/projects/opensource/servo/target/debug/deps/servo-
const NGINX_FORMAT_STRING: &str = r#"$textField[name='ip'] - $textField[name='username', null='-'] $delimited[start='[', end=']']{$dateField[name='date', format='%d/%b/%Y:%H:%M:%S %z']} $delimited[delim='"']{$opt{$textField[name='method'] }$textField[name='path']$opt{?$textField[name='query']} $textField[name='protocol']} $numberField[name='status'] $numberField[name='bytes'] $delimited[delim='"']{$textField[name='referrer', null='-']} $delimited[delim='"']{$textField[name='user_agent', null='-']}"#;
#!/bin/sh
if [ -z "$QNOTE_DEFAULT_EXT" ]; then
QNOTE_DEFAULT_EXT="md"
fi
QNOTE_DIR="~/.qnote"
QNOTE_DIR="${QNOTE_DIR/#\~/$HOME}"
if [ ! -d "$QNOTE_DIR" ]; then
{
"data": [
{
"market": {
"context": {
"away_score": 0,
"game_clock": 720,
"home_score": 0,
"market_number": 1,
"quarter": 1
use clap::{App, Arg};
pub fn create_wordlebot_cli_app() -> App<'static> {
App::new("wordlebot")
.version("0.1")
.author("Bryan G. <[email protected]>")
.about(
"Simple wordle solving bot. This bot can be used in three different
modes of operation.