Skip to content

Instantly share code, notes, and snippets.

View matkarlg's full-sized avatar

Mathias Karlgren matkarlg

  • Göteborg / Gothenburg, Sweden
View GitHub Profile
@kdorff
kdorff / distance-sensor-0.yaml
Last active March 3, 2024 16:11
Break beam sensor using VL53L0X for Home Assistant using ESPHome
##
## A standard "break beam sensor" uses a laser or LED with a device on both
## sides of an opening and is triggered when something breaks the beam
## (such as a customer walking through the beam). Some garage doors use them.
## Stores often use them at the entrace to ring a chime when a customer enters
## or leaves.
##
## This is my attempt at using a VL53L0X i2c Time of Flight sensor
## as a break beam sensor in Home Assistant using ESPHome.
##
@ChipCE
ChipCE / readme.md
Last active April 24, 2024 14:54
Klipper bed mesh on print area only macro install guide

READ THIS FIRST

Adaptive bed mesh is merged into klipper master branch. You can use this feature without this custom macro. Official klipper adaptive bed mesh

Klipper mesh on print area only install guide

What this macro do

  • This macro will dynamically changing the bed mesh area based on the size of the parts will be printed. The fw will only probe on the area that the part will be printed (plus mesh_area_offset value)
@matthewberryman
matthewberryman / greengrass.service
Last active November 25, 2019 11:42
greengrass systemd
[Unit]
Description=greengrass daemon
After=network.target
[Service]
ExecStart=/greengrass/ggc/core/greengrassd start
Type=simple
RestartSec=2
Restart=always
User=root
@cryzed
cryzed / fix-infinality.md
Last active April 30, 2024 22:01
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@developit
developit / example.js
Last active November 5, 2023 11:16
Preact + Web Components = <333 Demo: http://www.webpackbin.com/VJyU9wK5W
import { h, Component } from 'preact';
import Markup from 'preact-markup';
import register from './preact-custom-element';
// just a proxy component: WC -> Preact -> WC
const A = () => <x-b foo="initial foo from <x-a>" />;
// stateful component that can re-render
class B extends Component {
render(props, state) {
@ertseyhan
ertseyhan / remount.sh
Created February 2, 2016 20:51
Temporarily increase size of tmp folder on Arch linux
#!/bin/bash
sudo mount -o remount,size=10G,noatime /tmp
echo "Done. Please use 'df -h' to make sure folder size is increased."
@mclarke47
mclarke47 / reddit unsave hack
Last active December 20, 2023 01:45
a complete hack to click the unsave buttons on all reddit posts on screen.
Doesn't seem to work anymore
$("a").filter(function(index){return $(this).text()==="unsave"}).click();
New
document.querySelectorAll("a").forEach(function(index,other){if(index.text==="unsave"){index.click();}});
@ForestJay
ForestJay / git_cleanup
Last active February 28, 2024 03:21 — forked from kevinwright/git_cleanup
#!/bin/bash
# WARNING
# This expects your repository to be in ~/git . If your repository is elsewhere you will need to alter the script.
# SYNOPSIS
# git_cleanup [repo name] [-xl]
# DESCRIPTION
# This script allows people to delete (-x) the history of a directory OR destroy (-l) the history of a directory and just
@pascalpoitras
pascalpoitras / config.md
Last active April 28, 2024 23:12
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@mtigas
mtigas / gist:952344
Last active April 3, 2024 07:57
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes: