Skip to content

Instantly share code, notes, and snippets.

View ricardoboss's full-sized avatar
💀
Writing code that's dead on arrival

Ricardo Boss ricardoboss

💀
Writing code that's dead on arrival
View GitHub Profile
@ricardoboss
ricardoboss / config.json
Created January 25, 2016 20:50 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@ricardoboss
ricardoboss / config.json
Created March 22, 2016 18:37 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#333",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#F3880B, 10%)",
"@brand-success": "#0CB94C",
@ricardoboss
ricardoboss / 11-news-php
Last active November 21, 2022 11:23
A shell script to fetch rss feeds in php and print them in a neat way with colors and formatting.
#!/usr/bin/php
<?php
declare(strict_types=1);
/**
* Shell script to fetch rss feeds.
*
* @author Ricardo Boss <mail@ricardoboss.de>
*/
// feed configuration
@ricardoboss
ricardoboss / config.fish
Last active August 22, 2021 05:16
~/.config/fish/config.fish
# Path to Oh My Fish install.
set -q XDG_DATA_HOME
and set -gx OMF_PATH "$XDG_DATA_HOME/omf"
or set -gx OMF_PATH "$HOME/.local/share/omf"
# Load Oh My Fish configuration.
source $OMF_PATH/init.fish
# Administration
alias ll="ls -aFl"
@ricardoboss
ricardoboss / profiles.json
Last active May 16, 2020 13:37
Windows Terminal Profiles
// This file was initially generated by Windows Terminal 0.11.1333.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@ricardoboss
ricardoboss / pre-push
Last active January 22, 2020 09:30 — forked from jasonbradley/run-tests
Bash script for running PHPUnit tests. Intended for use a pre-push git hook. Uses the project specific PHPUnit executable (vendor/bin/phpunit), the system-wide PHPUnit executable or phpunit.phar, whatever it finds first in this order.
#!/bin/bash
PHPUNIT_COMMAND=""
PHPUNIT_ARGS="--stderr --no-coverage"
# get phpunit executable (composer bin > system bin > phar file)
if [ -f "vendor/bin/phpunit" ]; then
PHPUNIT_COMMAND="vendor/bin/phpunit"
elif hash phpunit 2>/dev/null; then
PHPUNIT_COMMAND="phpunit"
@ricardoboss
ricardoboss / router.php
Created January 26, 2020 01:13
Simple php built-in webserver router script.
<?php
define('PUBLIC_DIR', __DIR__ . DIRECTORY_SEPARATOR . 'public');
$uri = $_SERVER['REQUEST_URI'];
// assume path exists in public directory
$path = PUBLIC_DIR . $uri;
// convert to realpath and substitute '.' and '..'
@ricardoboss
ricardoboss / deploy.sh
Created January 16, 2021 04:15
Deploy script for NPM (Vue) websites and git-auto-deploy
#!/usr/bin/env bash
# change to location of script
SCRIPT_PATH="${0%/*}"
if [[ "$0" != "$SCRIPT_PATH" && "$SCRIPT_PATH" != "" ]]; then
cd "$SCRIPT_PATH" || exit
fi
timestamp=$(date +"%Y-%m-%d_%H-%M-%S")
echo "Executing deploy script at $timestamp"
@ricardoboss
ricardoboss / CollectionExtensions.cs
Last active April 11, 2021 09:28
Generic implementation for syncing an ICollection with an IEnumerable
namespace System.Linq
{
public static class CollectionExtensions
{
public static void Sync<T>(this ICollection<T> source, IEnumerable<T> other, IEqualityComparer<T>? comparer = null)
{
comparer ??= EqualityComparer<T>.Default;
var itemsToAdd = other.Except(source, comparer);
var itemsToRemove = source.Except(other, comparer);
@ricardoboss
ricardoboss / README.md
Last active November 21, 2022 10:14
Watch any video in picture-in-picture mode

The link below can be added as a bookmark to your favourite browser. Whenever you are browsing Twitch, YouTube, Netflix, Disney+, Amazon Prime and possibly more (not tested), you can click the bookmark and pop-out the video into it's own, resizable window.

I always did this manually (optionally removing layers above the video to directly right click the video element), but it has become quite cumbersome (especially with twitch). Another thought I had was to write an extension which shows a button, but this bookmark is way simpler.

It works like this:

  1. Find video elements
  2. Filter them by which element is currently playing and has no errors