Skip to content

Instantly share code, notes, and snippets.

View refnode's full-sized avatar
🎯
Focusing

Sven Wilhelm refnode

🎯
Focusing
View GitHub Profile
@refnode
refnode / init.lua
Created March 11, 2023 18:09
Hammerspoon Config
-- ~/.config/hammerspoon/init.lua
--
----------------------------------------------------------------------
-- Hammerspoon configuration file
----------------------------------------------------------------------
-- Enable ICP and install the Hammerspoon cli "hs" to /usr/local/bin
require("hs.ipc")
hs.ipc.cliInstall()
@refnode
refnode / init.zsh
Created July 20, 2022 06:58
zsh-zle-fzf-kubernetes-widget
# small basic example to fetch all pods from k8s and fetch the pod definition into your vim
# alternative use 'bat' as cat replacement for great yaml syntax highlighting
fzf-kubectl-get-pods-widget() {
local selected namespace pod
local cmd="kubectl get pods -A"
local selected=( $(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m))
local ret=$?
if [ -n "$selected" ]; then
namespace=$selected[1]
pod=$selected[2]
@refnode
refnode / init.lua
Created July 21, 2022 21:37
neovim lua lsp config
require('lspconfig').sumneko_lua.setup {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
-- Setup your lua path
path = runtime_path,
},
diagnostics = {
hs.hotkey.bind(hyper, "p", function()
local win = hs.window.focusedWindow()
local f = win:frame()
local screen = win:screen()
local max = screen:frame()
f.x = 300
f.y = 100
f.w = max.x + 1864
f.h = max.y + 1055
win:setFrame(f)
@refnode
refnode / python-project.mk
Created March 27, 2015 11:33
Python Project Makefile
#!/usr/bin/env python
# Copyright 2012, refnode <refnode@gmail.com>
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@refnode
refnode / bootstrap.sh
Created April 9, 2019 19:11
macOS defaults
#!/bin/sh
defaults write com.apple.menuextra.battery ShowPercent -string YES
defaults write com.apple.systemuiserver menuExtras -array \
"/System/Library/CoreServices/Menu Extras/Clock.menu" \
"/System/Library/CoreServices/Menu Extras/Battery.menu" \
"/System/Library/CoreServices/Menu Extras/AirPort.menu" \
"/System/Library/CoreServices/Menu Extras/Bluetooth.menu" \
"/System/Library/CoreServices/Menu Extras/Displays.menu" \
"/System/Library/CoreServices/Menu Extras/Volume.menu"

Keybase proof

I hereby claim:

  • I am refnode on github.
  • I am refnode (https://keybase.io/refnode) on keybase.
  • I have a public key ASAXlGgDqePbTwemNbuV7xRMEdZUmsYYI75qXMKLgQLFcwo

To claim this, I am signing this object:

@refnode
refnode / build.sh
Created October 17, 2013 15:29
Mock Buildscript für Apache Thrift RPM
#!/bin/bash
# install package mock from fedora
# yum install rpmdevtools
#
# download thrift rpm from sys.fm
# the srpm file was not build in a clean dev environment,
# so requires some workarounds
# send some patches later
#
@refnode
refnode / buildout.cfg
Created December 19, 2012 20:10
buildout.cfg for mozilla/circus
## Installation notes for Debian/Ubuntu
## To use buildout you need some c-headerfiles.
## Simply call:
##
## $: wget http://www.python-distribute.org/bootstrap.py
## $: sudo apt-get install libzmq-dev python-dev
## $: python bootstrap.py
## $: bin/buildout
##
## Have fun with the examples
@refnode
refnode / gist:4181565
Created December 1, 2012 11:19
Check build deps for python-for-android
DEB_UBUNTU="build_essential zlib1g-dev cython"
# Check installation state of a debian package list.
# Return all missing packages.
function check_pkg_deb_installed() {
PKGS=$1
MISSING_PKGS=""
for PKG in $PKGS; do
CHECK=$(dpkg -s $PKG 2>&1)
if [ $? -eq 1 ]; then