Skip to content

Instantly share code, notes, and snippets.

View carlzulauf's full-sized avatar

Carl Zulauf carlzulauf

  • Unabridged Software
  • Denver, CO
View GitHub Profile
@carlzulauf
carlzulauf / .tmux.conf
Last active May 19, 2017 16:09
Tmux Config and Startup Script
# definitely DON'T use Ctrl+b. lame.
unbind C-b
# I never use the Insert key on the console, but it is a bit of a stretch
# set -g prefix IC
# ` is a cool prefix
set -g prefix `
set -g default-terminal "screen-256color"
@carlzulauf
carlzulauf / switch_or_launch.rb
Created April 16, 2017 08:51
use wmctrl and gtk-launch to bring an existing window to the front or launch the app
#!/usr/bin/ruby
base_cmd = ARGV[0]
cmd_pattern = Regexp.new(base_cmd)
running = `wmctrl -lx`.lines.grep(cmd_pattern)
if running.any?
window_id = running.first.match(/0x[0-9a-f]{8}/)[0]
exec "wmctrl -ia #{window_id}"
else
@carlzulauf
carlzulauf / Capfile
Last active December 10, 2016 01:59
Jekyll Capistrano Config
require "capistrano/setup"
require "capistrano/deploy"
require 'capistrano/chruby'
require 'capistrano/bundler'
@carlzulauf
carlzulauf / blog.conf
Last active December 10, 2016 00:33
Nginx Config for Static Blog with Let's Encrypt cert
server {
listen 80;
listen [::]:80;
server_name blog.linkleaf.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name blog.linkleaf.com;
# definitely DON'T use Ctrl+b. lame.
unbind C-b
# ` is a cool prefix
set -g prefix `
set -g default-terminal "screen-256color"
# this should allow for `` to be a literal `
bind-key ` send-prefix
# A simple tripwire utility to trigger breakpoints selectively.
#
# Requires `pry` and provides a pry console at the breakpoints.
#
# Place `binding.trip` anywhere you might want a breakpoint in your code
#
# def some_method(args)
# do_something
# binding.trip # <= breakpoint here
# do_something_else
@carlzulauf
carlzulauf / README.md
Last active May 5, 2016 15:16
The nautilus uri scheme

Add the following line to ~/.local/share/applications/mimeapps.list:

x-scheme-handler/nautilus=nautilus-handler.desktop

Place nautilus-handler.desktop into ~/.local/share/applications.

Place nautilus-hander into a PATH directory. I use ~/bin. Make this executable (chmod +x nautilus-handler).

Now nautilus uri scheme (example: nautilus:/some/path) links should work.

@carlzulauf
carlzulauf / restart_file_present.rb
Last active January 4, 2016 08:09 — forked from technicalpickles/restart_file_touched.rb
god/conditions/restart_file_present
module God
module Conditions
class RestartFilePresent < PollCondition
attr_reader :restart_file
def initialize
super
end
def restart_file=(file)
<%
# this is a multi-line comment
# in ERB
%>