Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
############################
# SSH Connection Script v3.0
# Jeff Heidel 2012
# Ian Thompson 2014
############################
##
@Dalrik
Dalrik / pipe.cpp
Created November 11, 2014 03:31
How to results array properly
class PipeExampleModule : public Module {
...
union {
struct pipe_results pr;
struct pipe_results2 pr2;
struct pipe_results3 pr3;
} results[NUMBER_PIPES];
...
// Nothing needed in constructor or destructor
...
@Dalrik
Dalrik / rc.lua
Last active August 29, 2015 14:06
Proper fullscreen flash in awesome
------------PUT THIS SOMEWHERE BEFORE YOUR awful.rules.rules TABLE-------------
-- Callback which restricts window properties to certain values
-- Use with caution, some programs could get stuck in an infinite loop
local function restrict(props)
return function(c)
for property, value in pairs(props) do
c:connect_signal("property::" .. property, function(c, state)
if state ~= value then
c[property] = value
end
#!/bin/bash
# Check whether there are child zsh processes to pull cwd from
# Sets $BEST_PID to the PID of the deepest zsh process
#
# Usage: checkchildren <PID>
function checkchildren() {
if [[ $# -eq 1 ]]; then
psdata=(`ps ho pid,comm --ppid=$1`)
if [[ ${#psdata[@]} -ge 2 ]]; then