Skip to content

Instantly share code, notes, and snippets.

Ed Marshall logic

Block or report user

Report or block logic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@logic
logic / command-completion.sh
Created Mar 11, 2017
terminal command-completion notifications from inside tmux
View command-completion.sh
# Like gnome-terminal's command-completion notifications, but usually run
# everything within a tmux window? No problem: add this to your .bashrc, and
# make sure `xdotool` is installed. Adjust the `notify-send` command line to
# taste.
#
# THIS DOESN'T WORK WITH WAYLAND. If you're on Wayland, let me know if you
# come up with a reliable way to identify the currently-focused window.
function notify_finished() {
# If we're not in tmux, fall back to gnome-terminal's notification.
[[ -z $TMUX_PANE ]] && __vte_prompt_command && return
@logic
logic / dcc.spec
Created Jan 31, 2017
DCC spec for Fedora
View dcc.spec
%define homedir %{_sysconfdir}/dcc
Summary: DCC is an anti-spam content filter
Name: dcc
Version: 1.3.158
Release: 1%{?dist}
URL: http://www.dcc-servers.net/dcc/
Source0: http://www.dcc-servers.net/dcc/source/old/dcc-%{version}.tar.Z
License: distributable for non-commercial use
BuildRequires: sendmail-devel
@logic
logic / gnome-background-rotation.service
Last active Sep 6, 2017
GNOME background rotation script
View gnome-background-rotation.service
[Unit]
Description=Rotate GNOME wallpaper
[Service]
Type=oneshot
ExecStart=/bin/bash ${HOME}/bin/rotate_background.sh
@logic
logic / userContent.css
Created Feb 23, 2015
Ever been annoyed that GMail displays emails in text/plain in a non-proportional font? Me too. Add this to chrome/userContent.css in your Firefox profile, and be happy.
View userContent.css
@-moz-document domain(mail.google.com)
{
.gs .ii,
textarea.Ak,
table tbody tbody tr td font,
div[aria-label="Message Body"], /* compose area */
table[aria-role="presentation"] .iA.g6, /* excerpts in conversation view */
tr.zA.yO span.y2, /* excerpts in inbox view */
.jj /* gmail offline */
{
View keybase.md

Keybase proof

I hereby claim:

  • I am logic on github.
  • I am logic (https://keybase.io/logic) on keybase.
  • I have a public key whose fingerprint is EBEC 168B 5D9D 4F73 5AFA 4374 3E55 2B7D A4DC 85AE

To claim this, I am signing this object:

@logic
logic / remaining.py
Last active Aug 29, 2015
Calculate how much money you'd leave on the table, if you quit your (stock-vesting) job right now.
View remaining.py
#!/usr/bin/env python
"""Calculate how much money you'd leave on the table if you quit right now.
Place a file named TICKER-stock.csv (where TICKER is the ticker symbol you
want to track) in the same directory as this script, formatted as:
MM/DD/YYYY,shares
Where MM is the month, DD is the date, and YYYY is the year that "shares"
@logic
logic / methodreq.py
Created May 17, 2012
Adding an HTTP method to urllib2.Request.
View methodreq.py
import urllib2
class MethodRequest(urllib2.Request):
def __init__(self, *args, **kwargs):
if 'method' in kwargs:
self._method = kwargs['method']
del kwargs['method']
else:
self._method = None
return urllib2.Request.__init__(self, *args, **kwargs)
@logic
logic / java.env
Created Apr 7, 2012 — forked from dln/java.env
Zookeeper RPM spec for CentOS and Fedora, including python bindings
View java.env
ZOO_LOG4J_PROP="INFO,ROLLINGFILE"
ZOO_LOG_DIR="/var/log/zookeeper/"
@logic
logic / mp_wrap.sh
Created Feb 15, 2012
Teach screen and tmux about the current ssh-agent configuration
View mp_wrap.sh
function multiplex_terminal() {
cp /dev/null $HOME/.sshvars
chmod 600 $HOME/.sshvars
for i in SSH_CLIENT SSH_TTY SSH_AUTH_SOCK SSH_CONNECTION
do
eval v="\$$i"
echo export $i=\"$v\" >> $HOME/.sshvars
done
multiplexor_path="`/usr/bin/which ${1}`"
shift
@logic
logic / hgwebdir-mongrel2.py
Created Apr 15, 2011
Simple wrapper for running hgwebdir under mongrel2
View hgwebdir-mongrel2.py
#!/usr/bin/env python
from m2wsgi.io.standard import WSGIHandler
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb.hgwebdir_mod import hgwebdir
app = hgwebdir('/path/to/hgweb.config')
handler = WSGIHandler(app, "tcp://127.0.0.1:9999")
handler.serve()
You can’t perform that action at this time.