Skip to content

Instantly share code, notes, and snippets.

@-moz-document url("chrome://browser/content/devtools/fontinspector/font-inspector.xhtml") {
.font-preview {
width: unset !important;
}
}
# Search shell history with peco: https://github.com/peco/peco
# Adapted from: https://github.com/mooz/percol#zsh-history-search
if which peco &> /dev/null; then
function peco_select_history() {
local tac
{ which gtac &> /dev/null && tac="gtac" } || \
{ which tac &> /dev/null && tac="tac" } || \
tac="tail -r"
BUFFER=$(fc -l -n 1 | eval $tac | \
peco --layout=bottom-up --query "$LBUFFER")
@yuttie
yuttie / pick_similar_term_color.py
Created November 20, 2015 04:12
Find a color for terminals that is perceptually similar to a given color
#!/usr/bin/python
from math import *
from random import *
import sys
# ANSI colors
ANSI_COLORS = [(0x00, 0x00, 0x00),
(0x80, 0x00, 0x00),
(0x00, 0x80, 0x00),
(0x80, 0x80, 0x00),
@yuttie
yuttie / company-simple-complete.el
Last active September 3, 2016 12:28 — forked from aaronjensen/company-complete-cycle.el
Enables tab to complete and cycle completions with company-mode, similar to neocomplete in vim
;;; company-simple-complete.el --- Vim-like completion style
;; Package-Requires: ((company))
;;; Commentary:
;; Modify company so that tab and S-tab cycle through completions without
;; needing to hit enter.
;;; Code:
# The original version is found at StackOverflow http://stackoverflow.com/a/25262470/2193620
# Modified by Yuta Taniguchi.
import sys
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfparser import PDFParser
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import PDFPageAggregator
from pdfminer.layout import LAParams, LTTextBox, LTTextLine, LTFigure
def make_counter(init):
count = [init]
def f():
count[0] += 1
return count[0] - 1
return f
c = make_counter(0)
c()
fn main() {
let mut x = (5, 4);
{
let mrx = &mut x;
let y = &mut mrx.0; // Error: 'mut' needed!
*y = 999;
y = &mut mrx.1;
*y = 000;
}
println!("{:?}", &x);
@yuttie
yuttie / firefox-stylish-force-toolbar-in-fullscreen.css
Created May 3, 2017 16:21
Stylish script for Firefox to force toolbars to appear in fullscreen mode.
@-moz-document url(chrome://browser/content/browser.xul) {
/* Force toolbars to appear in fullscreen mode. */
#main-window[inFullscreen][inDOMFullscreen] #navigator-toolbox,
#main-window[inFullscreen][inDOMFullscreen] #fullscr-toggler,
#main-window[inFullscreen][inDOMFullscreen] #sidebar-box,
#main-window[inFullscreen][inDOMFullscreen] #sidebar-splitter,
#main-window[inFullscreen]:not([OSXLionFullscreen]) toolbar:not([fullscreentoolbar=true]),
#main-window[inFullscreen] #global-notificationbox,
#main-window[inFullscreen] #high-priority-global-notificationbox {
visibility: initial !important;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yuttie
yuttie / config-5.0.16-gentoo.patch
Last active May 18, 2019 11:14
A patch of Linux kernel config that made console available again with NVIDIA's proprietary driver. Those changes were made according to https://wiki.gentoo.org/index.php?title=NVIDIA/nvidia-drivers&oldid=798107 . (Note that this is not a minimalistic patch to this end though.)
--- /boot/config-5.0.16-gentoo-no-console 2019-05-18 12:57:52.000000000 +0900
+++ /boot/config-5.0.16-gentoo 2019-05-18 18:18:10.000000000 +0900
@@ -484,6 +484,7 @@
CONFIG_ACPI_PROCESSOR_IDLE=y
CONFIG_ACPI_CPPC_LIB=y
CONFIG_ACPI_PROCESSOR=y
+# CONFIG_ACPI_IPMI is not set
CONFIG_ACPI_HOTPLUG_CPU=y
CONFIG_ACPI_PROCESSOR_AGGREGATOR=m
CONFIG_ACPI_THERMAL=m