Skip to content

Instantly share code, notes, and snippets.

View blueyed's full-sized avatar
💭
❤️ not eating nor abusing animals 🍀

Daniel Hahler blueyed

💭
❤️ not eating nor abusing animals 🍀
View GitHub Profile
-- Notification library
local _dbus = dbus; dbus = nil
local naughty = require("naughty") -- XXX: if loaded (with dbus available), notifications might not go to dunst/notify-osd anymore
dbus = _dbus
-- Alt-Tab: cycle through clients on the same screen and tag.
-- This must be a clientkeys mapping to have source_c available in the callback.
cyclefocus.key({altkey, }, "Tab", 1, {
-- cycle_filters = { function (c, source_c) return c.screen == source_c.screen end },
cycle_filters = { cyclefocus.filters.same_screen, cyclefocus.filters.common_tag },
display_notifications = false,
raise_clients = true,
modifier="Alt_L",
}),
cyclefocus.key({ altkey, "Shift", }, "Tab", 1, {
@blueyed
blueyed / _pip.zsh
Last active February 6, 2023 00:53
Zsh completion for pip (a tool for installing and managing Python packages), to be added to Zsh soonish.
#compdef -P pip[0-9.]#
#
# Completion script for pip (http://pypi.python.org/pypi/pip).
#
# Taken from https://github.com/zsh-users/zsh-completions/commit/890f3701
# (where it got removed). Original source:
# https://github.com/technolize/zsh-completion-funcs.
#
# Currently maintained in https://gist.github.com/blueyed/54a257c411310a28805a.
" Paste using [gist-paste](https://github.com/defunkt/gist).
command! -range=% -nargs=* Gistpaste call MyGistpaste(<line1>, <line2>, <f-args>)
fun! MyGistpaste(line1, line2, ...) abort
" let args = ['-t', &ft] " overrides -f?!
let args = []
" Autoset -f, if it's not given.
if index(a:000, '-f') == -1
let fname = fnamemodify(expand('%'), ':t')
let ext = fnamemodify(fname, ':e')
#!/usr/bin/env zsh
# Wrap call to python with a terminal (urxvt), to make server processes easier
# to debug (e.g. YouComleteMe).
# E.g.: python-in-terminal -c "import time; time.sleep(5)"
: ${PYTHON:=python2}
cmd=($PYTHON ${@})
exec urxvt -e ${cmd}
-- textbox_cmd: a textbox that executes a command regularly. {{{
-- Execute command and return its output.
function execute_command(command)
local fh = io.popen(command)
local r = {}
for i in fh:lines() do
r[#r+1] = i
end
io.close(fh)
return r
@blueyed
blueyed / -
Created January 10, 2015 16:51
function awful.client.istransientfor(c, parent)
local cur = c
while cur.transient_for do
if cur.transient_for == parent then
return true
end
cur = cur.transient_for
end
return false
end
@blueyed
blueyed / -
Created January 7, 2015 01:36
commit 9c28a611c1d90c9c97ad87da1b1ee9b768866cd0
Author: Daniel Hahler <git@thequod.de>
Date: Fri Dec 19 22:03:16 2014 +0100
Use ctrl-alt-shift for ISO 14755 mode
diff --git a/src/command.C b/src/command.C
index 05e6f65..da869cd 100644
--- a/src/command.C
+++ b/src/command.C
This file has been truncated, but you can view the full file.
diff --git c/old_test_project/fixtures/cities_light.json i/old_test_project/fixtures/cities_light.json
deleted file mode 100644
index 4afa26c..0000000
--- c/old_test_project/fixtures/cities_light.json
+++ /dev/null
@@ -1 +0,0 @@
-[{"pk": 1, "model": "cities_light.country", "fields": {"code2": "AD", "code3": "AND", "name": "Andorra", "tld": "ad", "alternate_names": "Principality of Andorra,Andora", "continent": "EU", "geoname_id": 3041565, "name_ascii": "Andorra", "slug": "andorra"}}, {"pk": 2, "model": "cities_light.country", "fields": {"code2": "AE", "code3": "ARE", "name": "United Arab Emirates", "tld": "ae", "alternate_names": "Vereinigte Arabische Emirate,Emirados \u00c1rabes Unidos,Emiratos \u00c1rabes Unidos,Zjednoczone Emiraty Arabskie,UAE", "continent": "AS", "geoname_id": 290557, "name_ascii": "United Arab Emirates", "slug": "united-arab-emirates"}}, {"pk": 3, "model": "cities_light.country", "fields": {"code2": "AF", "code3": "AFG", "name": "Afghanistan", "tld": "af", "alternate_names": "Islamic Rep
This file has been truncated, but you can view the full file.
[{"pk": 1, "model": "cities_light.country", "fields": {"code2": "AD", "code3": "AND", "name": "Andorra", "tld": "ad", "alternate_names": "Principality of Andorra,Andora", "continent": "EU", "geoname_id": 3041565, "name_ascii": "Andorra", "slug": "andorra"}}, {"pk": 2, "model": "cities_light.country", "fields": {"code2": "AE", "code3": "ARE", "name": "United Arab Emirates", "tld": "ae", "alternate_names": "Vereinigte Arabische Emirate,Emirados \u00c1rabes Unidos,Emiratos \u00c1rabes Unidos,Zjednoczone Emiraty Arabskie,UAE", "continent": "AS", "geoname_id": 290557, "name_ascii": "United Arab Emirates", "slug": "united-arab-emirates"}}, {"pk": 3, "model": "cities_light.country", "fields": {"code2": "AF", "code3": "AFG", "name": "Afghanistan", "tld": "af", "alternate_names": "Islamic Republic of Afghanistan,Afeganist\u00e3o,Afganistan", "continent": "AS", "geoname_id": 1149361, "name_ascii": "Afghanistan", "slug": "afghanistan"}}, {"pk": 4, "model": "cities_light.country", "fields": {"code2": "AG", "code3": "ATG"