Skip to content

Instantly share code, notes, and snippets.

body,
body.system-font {
font-family: sans-serif;
}
.column {
flex-grow: 1;
}
.status__content {
@elomatreb
elomatreb / adjustChapterTimings.rb
Created January 17, 2018 11:07
Utility script that can adjust (shift forwards/backwards) the timing of Matroska chapters (given in XML chapter files, obtainable with `mkvextract somefile.mkv chapters out.xml`)
#!/usr/bin/env ruby
require "fileutils"
require "nokogiri"
class Timestamp
def self.parse(raw)
return nil unless raw.match?(/\A\d\d:\d\d:\d\d.\d+\z/)
hours, minutes, seconds = raw.split ":"
ts = 0r
@elomatreb
elomatreb / renamer.rb
Last active January 11, 2018 03:27
Renaming script I use for managing episodes of downloaded series batches
#!/usr/bin/env ruby
require "fileutils"
require "highline"
# Characters illegal in most filenames
ILLEGAL_CHARS = %w[< > : " / \\ | * ?]
cli = HighLine.new
@keyframes lol {
0% {
opacity: 0;
transform: rotate(-1440deg) scale(0);
}
100% {
opacity: 1;
transform: rotate(0deg) scale(1);
}
<?xml version="1.0" encoding="UTF-8" ?>
<Root>
<KeyboardLayout>de-DE</KeyboardLayout>
<MouseXMode Value="Bindings_MouseRoll" />
<MouseXDecay Value="0" />
<MouseYMode Value="Bindings_MousePitch" />
<MouseYDecay Value="0" />
<MouseReset>
<Primary Device="{NoDevice}" Key="" />
<Secondary Device="{NoDevice}" Key="" />
@elomatreb
elomatreb / github.css
Created September 2, 2017 07:01
Some of my userstyles. Usually just for proper fonts
@-moz-document domain("github.com") {
body,
.markdown-body,
.default-label .sha .ellipses,
.tooltipped::after {
font-family: sans-serif;
}
pre,
code,
@elomatreb
elomatreb / gh.css
Created August 18, 2017 22:19
Userstyle to make Github actually use system fonts (if you have changed them). Probably not exhaustive but all occurrences of sans-serif and monospace I found
@-moz-document domain("github.com") {
body,
.markdown-body,
.default-label .sha .ellipses,
.tooltipped::after {
font-family: sans-serif;
}
pre,
code,
@elomatreb
elomatreb / css_matchers.rb
Created July 17, 2017 11:51
Duct-tape HTML testing. No capybaras were required and/or harmed during development
require "nokogiri"
RSpec::Matchers.define :have_elements_matching do |selector|
match do |view|
Nokogiri::HTML(view).match(selector).any?
end
end
RSpec::Matchers.define :have_one_element_matching do |selector|
match do |view|
@elomatreb
elomatreb / bitmask.rb
Created March 22, 2017 08:47
Ruby utility for parsing bitmask options.
# Usage:
# Bitmask[:list, :of, :option, :keys, value]
# where the last key in the list will be represented by the least significant
# bit in value.
#
# Example:
# Bitmask[:optionA, nil, :optionB, :optionC, 0b1010]
# #=> {:optionA=>true, :optionB=>true, :optionC=>false}
# Use nils to indicate bits that do not have a meaning.
class Bitmask
[378849.675552] usb 2-1: new high-speed USB device number 9 using ehci-pci
[378851.392233] usb 2-1: new high-speed USB device number 10 using ehci-pci
[378852.849039] usb_storage: disagrees about version of symbol kmem_cache_alloc_trace
[378852.849042] usb_storage: Unknown symbol kmem_cache_alloc_trace (err -22)
[378852.849059] usb_storage: disagrees about version of symbol wake_up_process
[378852.849060] usb_storage: Unknown symbol wake_up_process (err -22)
[378852.849360] usb_storage: disagrees about version of symbol kmalloc_caches
[378852.849361] usb_storage: Unknown symbol kmalloc_caches (err -22)
[378852.867154] usb_storage: disagrees about version of symbol kmem_cache_alloc_trace
[378852.867156] usb_storage: Unknown symbol kmem_cache_alloc_trace (err -22)