Skip to content

Instantly share code, notes, and snippets.

View eacousineau's full-sized avatar

Eric Cousineau eacousineau

View GitHub Profile
@eacousineau
eacousineau / personal_git_bash_aliases_suggestion.sh
Created June 25, 2021 19:28
Using separate github accounts and keys
_DOTFILES=<DEFINE THIS>
use-personal-git() {
export GIT_AUTHOR_EMAIL=personal@email.com
export GIT_COMMITTER_EMAIL=${GIT_AUTHOR_EMAIL}
export GIT_SSH=${_DOTFILES}/ssh_personal_for_git.sh
export PS1="personal!$ "
}
@eacousineau
eacousineau / scrub_notifications.py
Created November 25, 2020 22:15
Scrub / Filter out Ubuntu 18.04 Desktop Notifications (via D-Bus)
"""
Runs a DBus message loop with a callback to receive... pretty much
anything on a session bus.
Listen to the Notify event; if it's a message we hate, record it, then
listen for the return message, and kill that message.
Tested On:
- Ubuntu 18.04.5 LTS, CPython 3.6.9 (dbus: 1.2.6, gi: 3.26.1)
To test, try running the following with and without this script running:
Gotta catch 'em all!
Last updated: 2020-03-23
[X] - Site taken down
[ ] - Site still up
[X] https://luanzi.myshopify.com/collections/home-gym/products/adjustable-dumbbell-the-work-of-multiple-dumbbells-in-one
[X] https://aback.rooftop1.com/collections/home-gym/products/adjustable-dumbbell-the-work-of-multiple-dumbbells-in-one
[X] https://blshaln.myshopify.com/collections/sports-fitness/products/adjustable-dumbbell-the-work-of-multiple-dumbbells-in-one
[ ] https://www.wajious.com/shopping/sports-outdoors/home-gym.html/adjustable-dumbbell-the-work-of-multiple-dumbbells-in-one
attrs==19.1.0
backcall==0.1.0
bleach==3.1.0
decorator==4.3.2
defusedxml==0.5.0
entrypoints==0.3
ipykernel==5.1.0
ipython==7.3.0
ipython-genutils==0.2.0
ipywidgets==7.4.2
@eacousineau
eacousineau / encfs_tmp.sh
Last active November 10, 2018 17:50
Makes and mounts temporary encfs partition that is removed upon program exit.
#!/bin/bash
# Makes and mounts temporary encfs partition that is removed upon program exit.
# Requires encfs.
set -eu -o pipefail
tmp=$(mktemp -d)
enc=${tmp}/.enc
mnt=${tmp}/mnt
@eacousineau
eacousineau / dict_list_to_recarray.py
Last active August 29, 2015 14:00
dict_list_to_recarray.py
#!/usr/bin/python
import numpy as np
def dict_list_to_recarray(items):
"""
@brief Take a loose list of dictionaries, and turn them into a recarray with
fields defined as 'object' for clarity
@param items Iterable collection of dictionaries
@author Eric Cousineau <eacousineau@gmail.com>
@note xref: http://docs.scipy.org/doc/numpy/reference/generated/numpy.core.records.fromrecords.html
#!/usr/bin/python
import sys
class Tee(object):
"""
Allow forking of output to stdout and other files
From: http://stackoverflow.com/questions/11325019/output-on-the-console-and-file-using-python
@author Thrustmaster <http://stackoverflow.com/users/227884/thrustmaster>
@author Eric Cousineau <eacousineau@gmail.com>
"""
@eacousineau
eacousineau / diff.patch
Created April 5, 2014 18:33
musescore_issue_fPIC.patch
From 6a16f029b4d5d5be1fe202bc961d919d85764203 Mon Sep 17 00:00:00 2001
From: eacousineau <eacousineau@gmail.com>
Date: Sat, 5 Apr 2014 13:31:49 -0500
Subject: [PATCH] CMakeLists: Haphazardly add -fPIC for gcc to see if we can
squelch the Qt5.2 #error directive
---
CMakeLists.txt | 5 +++++
aeolus/CMakeLists.txt | 2 +-
audiofile/CMakeLists.txt | 4 +++-
@eacousineau
eacousineau / cellexpand.m
Last active August 29, 2015 13:57
cellexpand.m - Expand cell array value into varargout (similar to deal, but only accepts one argument)
%> @brief cellexpand Expand a cell (or array) value into the output
%> arguments. Similar to deal(), but only accepts one input argument.
%> @param X Cell or matrix vector to be distributed to varargout
function [varargout] = cellexpand(X)
if ismatrix(X)
X = num2cell(X);
end
assert(iscell(X));
@eacousineau
eacousineau / gist:8823441
Created February 5, 2014 13:20
package version path
# ros-hydro-gazebo-*
ros-hydro-gazebo-msgs
ros-hydro-gazebo-msgs-current amd64 2.4.1-1precise ros-hydro-gazebo-msgs
ros-hydro-gazebo-plugins
ros-hydro-gazebo-plugins-current amd64 2.4.1-3precise ros-hydro-gazebo-plugins
ros-hydro-gazebo-ros
ros-hydro-gazebo-ros-control
ros-hydro-gazebo-ros-control-current amd64 2.4.1-1precise ros-hydro-gazebo-ros-control
ros-hydro-gazebo-ros-current amd64 2.4.1-3precise ros-hydro-gazebo-ros
ros-hydro-gazebo-ros-pkgs