View pytest-ipdb-in-testdir.py
1 2 3 4 5 6 7 8 9 10
diff -r fa62c5c63c2f testing/test_assertrewrite.py
--- a/testing/test_assertrewrite.py Mon Jan 19 22:34:43 2015 +0100
+++ b/testing/test_assertrewrite.py Fri Feb 27 19:11:10 2015 +0100
@@ -123,6 +123,13 @@
assert False, "something bad!"
assert getmsg(f) == "AssertionError: something bad!\nassert False"
+ def test_runpytest_ipdb(self, testdir):
+ testdir.makepyfile("""
+ def test_foo():
View my_tasklist_update_integration.lua
1 2 3 4 5 6 7 8 9 10
-- Create a tasklist widget
mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons, {
-- style
font = "Ubuntu Sans 10",
-- symbol to use to indicate certain client properties
-- sticky = args.sticky or theme.tasklist_sticky or "▪"
-- ontop = args.ontop or theme.tasklist_ontop or '⌃'
-- floating = args.floating or theme.tasklist_floating or '✈'
-- maximized_horizontal = args.maximized_horizontal or theme.tasklist_maximized_horizontal or '⬌'
-- local maximized_vertical = args.maximized_vertical or theme.tasklist_maximized_vertical or '⬍'
View my_tasklist_update.lua
1 2 3 4 5 6 7 8 9 10
-- Add tooltip to tasklist {{{
-- Ref: https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1250
-- NOTE: interferes/prevents sloppy focus when coming through the tooltip.
local my_tasklist_update = function(w, buttons, label, data, objects)
awful.widget.common.list_update(w, buttons, label, data, objects)
 
for _,o in ipairs(objects) do
if not data[o].tooltip then
data[o].tooltip = awful.tooltip({
objects = { data[o].tb },
View awesome_request_activate.lua
1 2 3 4 5 6 7 8 9 10
client.disconnect_signal("request::activate", awful.ewmh.activate)
client.connect_signal("request::activate", function(c, context)
-- context: 'rules' or 'ewmh'
-- bnote(bdump({'request::activate', c_isvisible=c:isvisible(), context=context}))
bdebug({'request::activate', c_isvisible=c:isvisible(), context=context}, 'request_activate')
if awesome.startup then
client.focus = c
c:raise()
return
end
View awesome-focus-filter.lua
1 2 3 4 5 6 7 8 9 10
focus = function(c)
-- if c.startup_id and snid_props_cb[c.startup_id] then
-- -- Do not focus (yet).
-- return false
-- end
local r
if not awful.client.focus.filter(c) then
r = false
elseif c.type ~= "normal" and c.transient_for then
-- Only restrict windows with parents!
View awesome_disable_naughty_dbus.lua
1 2 3 4
-- 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
View cyclefocus-alttab.lua
1 2 3 4 5 6 7 8 9 10
-- 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, {
View _pip.zsh
1 2 3 4 5 6 7 8 9 10
#compdef pip pip2 pip2.4 pip2.5 pip2.6 pip2.7 pip3.0 pip3.1 pip3.2 pip3.3 pip3.4
#
# 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.
#
# Authors
# -------
#
View gist-paste.vim
1 2 3 4 5 6 7 8 9 10
" 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')
View python-in-terminal.zsh
1 2 3 4 5 6 7 8 9 10
#!/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}
Something went wrong with that request. Please try again.