Skip to content

Instantly share code, notes, and snippets.

@matthewlmcclure
matthewlmcclure / gist:6124117
Created July 31, 2013 17:22
Log information about the objects replaced by Python Mock, patch. Combine with similar logging in your application to debug patching.
--- mock.py~ 2013-07-31 13:20:48.000000000 -0400
+++ mock.py 2013-07-31 13:19:57.000000000 -0400
@@ -32,9 +32,12 @@
__version__ = '0.8.0'
+import logging
import pprint
import sys
@matthewlmcclure
matthewlmcclure / mock.py.diff
Last active December 20, 2015 11:29
Log information about the objects replaced by Python Mock, patch. Combine with similar logging in your application to debug patching.
--- mock.py~ 2013-07-31 13:20:48.000000000 -0400
+++ mock.py 2013-07-31 17:43:13.000000000 -0400
@@ -32,9 +32,12 @@
__version__ = '0.8.0'
+import logging
import pprint
import sys
@matthewlmcclure
matthewlmcclure / kill-processes-orphaned-by-jenkins.sh
Last active January 3, 2016 12:09
Kill processes orphaned by Jenkins
#! /bin/bash
# Kill processes orphaned by Jenkins
# Work around Java's use of SIGTERM rather than SIGKILL and
# Jenkins's lack of any workaroud in the box.
# Suggested usage:
#
# $ crontab -l
@matthewlmcclure
matthewlmcclure / 0_reuse_code.js
Created January 18, 2014 15:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@matthewlmcclure
matthewlmcclure / com.twitter.user.js
Created January 15, 2012 05:16
Load new tweets automatically.
(function() {
// ==UserScript==
// @name Load new tweets automatically.
// @namespace http://matthewlmcclure.com
// @match https://twitter.com/*
// ==/UserScript==
var updating = true;
var event = document.createEvent('MouseEvents');
$ cat ./notes-invalid-json.csv
User,name,title,owner,ownedByMe,JSON
user@example.com,notes/placeholder-id,,user@example.com,True, {"body": {"text": {"text": "\\""}}, "createTime": "2022-03-10T13:10:00Z", "name": "notes/placeholder-id", "ownedByMe": true, "owner": "user@example.com", "permissions": [{"email": "user@example.com", "name": "notes/placeholder-id/permissions/placeholder-id", "role": "OWNER", "user": {"email": "user@example.com"}}], "trashTime": "Never", "updateTime": "2022-03-10T13:10:00Z"}
$ gam csv ./notes-invalid-json.csv quotechar " " gam user user@example.com create note json "~JSON" copyacls
2022-03-10T13:17:09.932+00:00,0/1,Using 1 process...
Command: gam user user@example.com create note json >>>"{"body": {"text": {"text": "\\""}}, "createTime": "2022-03-10T13:10:00Z", "name": "notes/placeholder-id", "ownedByMe": true, "owner": "user@example.com", "permissions": [{"email": "user@example.com", "name": "notes/placeholder-id/permissions/placeholder-id", "role": "OWNER", "user": {"email": "us