Skip to content

Instantly share code, notes, and snippets.

@kwasmich
kwasmich / EvilMouse.js
Last active May 1, 2024 20:38
UserScript for browser to enable Disney Plus on Linux
// ==UserScript==
// @name Enable Disney Plus on Linux
// @description This is your new file, start writing code
// @match *://*.disneyplus.com/*
// ==/UserScript==
Object.defineProperty(navigator, "userAgent", { value: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36", configurable: true, enumerable: true, writable: true });
@kwasmich
kwasmich / Skip YouTube Ads.js
Last active May 24, 2023 15:30
Script for Userscripts browser extension to skip ads on Youtube.
// ==UserScript==
// @name Skip YouTube Ads
// @description This is your new file, start writing code
// @match *://*.youtube.com/*
// ==/UserScript==
function skipAd() {
const adPlaying = document.body.querySelector(".ad-showing");
if (!adPlaying) {
@peterwwillis
peterwwillis / git-prune.sh
Created July 28, 2018 18:58
Prune Git's local orphan references, merged feature branches, remote tracking references, and more
#!/bin/bash
# Prune local orphan refs
git prune -v
# Deletes all stale (local) remote-tracking branches under origin.
# These stale branches have already been removed from the remote repository
# referenced by <name>, but are still locally available.
git remote prune origin
@actuino
actuino / bt_speaker-raspberry_pi-zero_w.md
Last active April 19, 2024 04:57
Setting up a Bluetooth Speaker from the command line on a raspberry Pi Zero W

The setup of a bluetooth speaker on a Pi Zero W is pretty touchy.

Please get in touch via Twitter @actuino or http://www.actuino.fr/ if you've got comments or improvements to this quick draft.

First checks

  • Use a solid power source
  • check the speaker works on another hardware (android phone f.i.)
  • make sure you've updated your Raspbian, install and run rpi-update just in case.
@alces
alces / ansible_local_playbooks.md
Last active April 5, 2024 18:28
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@tylerneylon
tylerneylon / learn.lua
Last active April 28, 2024 22:23
Learn Lua quickly with this short yet comprehensive and friendly script. It's written as both an introduction and a quick reference. It's also a valid Lua script so you can verify that the code does what it says, and learn more by modifying and running this script in your Lua interpreter.
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
@flarik
flarik / dot.powrc.sh
Created June 12, 2013 10:25
Pow's .porwrc config file for use with RVM's config files .rvmrc or .ruby-version (+ optional .ruby-gemset)
if [ -f "${rvm_path}/scripts/rvm" ]; then
source "${rvm_path}/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
elif [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then
rvm use `cat .ruby-version`@`cat .ruby-gemset`
elif [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
@ecampidoglio
ecampidoglio / cpustatus.sh
Created February 21, 2013 23:42
A Bash script that prints the current state of the CPU on a Raspberry Pi. It displays variables like temperature, voltage and speed.
#!/bin/bash
# cpustatus
#
# Prints the current state of the CPU like temperature, voltage and speed.
# The temperature is reported in degrees Celsius (C) while
# the CPU speed is calculated in megahertz (MHz).
function convert_to_MHz {
let value=$1/1000
echo "$value"
@johnp
johnp / inputSpeed.c
Created September 24, 2012 00:44
Measure the maximum speed of GPIO input polling using native C register access
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sched.h>