Skip to content

Instantly share code, notes, and snippets.

@pythoninthegrass
pythoninthegrass / game.sh
Last active April 18, 2024 17:37
sunshine, gamescope + steam
#!/usr/bin/env bash
# TODO: test wayland gamescope session
export DISPLAY=:0 # vnc
export WAYLAND_DISPLAY=:2 # xwayland
export DXVK_HDR=1
export ENABLE_GAMESCOPE_WSI=1
# Check existing X server
start_x() {
@strzlee
strzlee / gamescope-session.sh
Created February 7, 2022 09:45
gamescope-session
#!/bin/sh
source /etc/gamescope-session.conf
export SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0
# Source environment from ~/.config/environment.d
set -a
for i in ~/.config/environment.d/*.conf ;
do
[[ -f "${i}" ]] && source "${i}"
@Asjas
Asjas / reset.css
Created May 19, 2021 07:09
Modern CSS Reset - Andy Bell
// https://piccalil.li/blog/a-modern-css-reset
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default margin */
@keithdevon
keithdevon / hd-gutenberg-column-fix.css
Last active December 18, 2020 22:26
Gutenberg columns block alignment fix
:root {
--gutter: 32px;
}
@media screen and (min-width: 782px) {
/* For the '25's' in the 25 / 50 / 25 variation */
.wp-block-column[style='flex-basis:25%'] {
flex-basis: calc(var(--gutter) * 2) !important;
@andrsd
andrsd / customkeys.md
Last active March 19, 2020 12:23
Volume on Up/Down buttons for OSMC remote control in KODI

Place this in ~/.kodi/userdata/keymaps/customkeys.xml

<keymap>
 <visualisation>
  <keyboard>
   <key id="166">volumeup</key>
   <key id="167">volumedown</key>
   <key id="168">skipnext</key>
   <key id="169">skipprevious</key>
 playpause
@alexellis
alexellis / colour_cycle.py
Last active August 16, 2016 20:24
colour_cycle.py
# sunrise.py
# colors = [
# {"r": 0, "g": 0, "b": 0},
# {"r": 255, "g": 0, "b": 0},
# {"r": 0, "g": 255, "b": 0},
# {"r": 0, "g": 0, "b": 255},
# {"r": 255, "g": 255, "b": 255},
# {"r": 0, "g": 0, "b": 0}
# ]
@lurch
lurch / pizero_usb_internet.sh
Last active November 1, 2022 16:59
Script to automatically provide internet access to a PiZero connected to a Linux host over a USB-network (only tested on Ubuntu 14.04)
#!/bin/bash
# Automatically setup routing and DNS for a PiZero connected over a USB-network
# NOTE: Before running this script for the first time, you need to run the
# following two commands on your Linux PC
# sudo sysctl -w net.ipv4.ip_forward=1
# sudo iptables -t nat -A POSTROUTING -s 169.254.0.0/16 -o eth0 -j MASQUERADE
# (replace eth0 in the second command with your internet-facing network device,
# e.g. wlan0 on a laptop)
# The Avahi-discovered hostname
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@paulirish
paulirish / what-forces-layout.md
Last active April 30, 2024 17:56
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@wpmark
wpmark / null-instagram-widget-output.php
Last active August 29, 2015 14:06
Null Instagram Widget Output in Template File
<?php
/* output instagram widget */
the_widget(
'null_instagram_widget',
array(
'username' => 'username',
'title' => '',
'number' => '1',
'size' => 'large',
'target' => '_blank',