Skip to content

Instantly share code, notes, and snippets.

Avatar
🚜
Tenacious Tractor

Sven Anderson ansiwen

🚜
Tenacious Tractor
  • Red Hat
  • Berlin, Germany
  • Twitter @ansiwen
View GitHub Profile
@ansiwen
ansiwen / moveWindowOneSpace.lua
Created Feb 5, 2021
moveWindowOneSpace for hammerspoon
View moveWindowOneSpace.lua
local hotkey = require "hs.hotkey"
local window = require "hs.window"
local spaces = require "hs._asm.undocumented.spaces"
function getGoodFocusedWindow(nofull)
local win = window.focusedWindow()
if not win or not win:isStandard() then return end
if nofull and win:isFullScreen() then return end
return win
end
View macos_notes.md
@ansiwen
ansiwen / arduino_waves.ino
Last active Dec 10, 2020
1d wave model for arduino
View arduino_waves.ino
// Use if you want to force the software SPI subsystem to be used for some reason (generally, you don't)
// #define FASTLED_FORCE_SOFTWARE_SPI
// Use if you want to force non-accelerated pin access (hint: you really don't, it breaks lots of things)
// #define FASTLED_FORCE_SOFTWARE_SPI
// #define FASTLED_FORCE_SOFTWARE_PINS
#include <FastLED.h>
#include "rgbw.h"
// How many leds are in the strip?
#define NUM_LEDS 300
@ansiwen
ansiwen / create_tables.go
Created Dec 5, 2020
Gamma correction tables for LEDs on Arduino
View create_tables.go
import (
"fmt"
"math"
"strings"
)
func printGammaTable(start, end int, gamma float64) {
g_s := strings.ReplaceAll(fmt.Sprintf("%1.1f", gamma), ".", "_")
fmt.Printf("\nconst uint8_t PROGMEM gamma_%s_%dto%d_table[] = {\n", g_s, start, end)
for x := 0; x < 256; x++ {
@ansiwen
ansiwen / keep_dialogs.py
Created Dec 7, 2018
hexchat addon for keeping dialogs open after restart
View keep_dialogs.py
from __future__ import print_function
import hexchat
__module_name__ = "keep_dialogs"
__module_author__ = "ansiwen"
__module_version__ = "1"
__module_description__ = "Saves current dialogs for next start"
def unload_cb(userdata):
networks = {}
@ansiwen
ansiwen / config.ml
Last active Dec 5, 2017
Reproducer for exception Unix.Unix_error(Unix.EBADF, "check_descriptor", "")
View config.ml
open Mirage
let stack = generic_stackv4 default_network
let cond = conduit_direct stack
let http_srv = http_server @@ cond
let res_dns = resolver_dns stack
@ansiwen
ansiwen / auto-star-openstack-repo.py
Last active Jun 21, 2017 — forked from jd/auto-star-openstack-repo
Automatically star any OpenStack Git repository which contains own commits
View auto-star-openstack-repo.py
#!/usr/bin/env python
from github import Github
from getpass import getpass
USERNAME = raw_input("GitHub username: ")
PASSWORD = getpass()
ORGS = ("openstack", "stackforge", "openstack-dev", "openstack-infra")
g = Github(USERNAME, PASSWORD)
View rechecks.py
import json
import re
import requests
projects = [
'tripleo-heat-templates',
'tripleo-common',
'tripleo-puppet-elements',
'puppet-tripleo',
]
@ansiwen
ansiwen / python-profiling.md
Last active Feb 12, 2020
Python profiling
View python-profiling.md
@ansiwen
ansiwen / t450s-notes.md
Last active Jan 20, 2016
T450s on Fedora 22 Notes
View t450s-notes.md

T450s on Fedora 22

Touchpad

two-finger-click for righ-click

  • For gnome session:
$ gsettings set org.gnome.desktop.peripherals.touchpad click-method fingers