Skip to content

Instantly share code, notes, and snippets.

@bmccormack
bmccormack / example_cron.txt
Last active December 21, 2021 03:03
Tips and tricks for being successful with CRON
* * * * * env > /tmp/env.output
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:~/bin
PYTHONPATH=/usr/lib/python2.7/dist-packages:$PYTHONPATH
* * * * * env > /tmp/env2.output
*/2 * * * * . /home/ben/example.sh > /home/ben/.example.log 2>&1
* * * * * date > .date.tmp
@bmccormack
bmccormack / readme.md
Last active May 26, 2019 14:55
Relative anchor links for your documentation

You know relative anchor links, right? They're the things that help you to link to a section of a document, e.g. https://example.com/your-doc#part-of-doc. This is especially helpful for customer support help centers (knowledge bases, documentation, etc).

I can never ever remember how to do this, so I'm making this gist to store my brain on the internet. Here are some things I forget:

  • Use name to name your relative link
  • Don't include # in the name value
@bmccormack
bmccormack / custom_and_log.js
Created September 28, 2017 13:18
Set FullStory custom vars and log them to FS.log() at the same time
// Use this to set FullStory custom var data and log data at
// the same time. This will cause your custom vars to be visible
// in the FullStory javascript console, but they will not be
// visible in the browser console to the end user.
// See http://help.fullstory.com/develop-js/setuservars
// for how to format data.
function setUserVarsAndLog(data){
FS.setUserVars(data);
FS.log(data);
@bmccormack
bmccormack / query_zendesk_search_delete_spam.py
Last active November 16, 2017 14:32
Delete a bunch of sh*t tickets from Zendesk. Ahem.
import requests
import urllib
import re
import datetime
from secrets import zendesk_user, zendesk_token
from util import jprint
import sys
import time
@bmccormack
bmccormack / hide_by_label_name.js
Created December 19, 2017 15:34
Hide Trello cards with label name
//change "Received" to the name of the label whose card you want to hide.
$('span[title^="Received"]').closest('.list-card').addClass('hide')
@bmccormack
bmccormack / bookmarklet.md
Created January 15, 2018 17:55
Bookmarklet to open Zap History while viewing a Zapier Zap

Add a new bookmarklet in Chrome called "Zap History". For the URL, enter the following:

javascript:(function()%7Bwindow.open(location.href.split("%2Fapp%2F")%5B0%5D %2B "%2Fapp%2Fhistory%3Fpage%3D1%26root_id%3D" %2B location.href.split("%2Feditor%2F")%5B1%5D.split("%2F")%5B0%5D%2C "_blank")%7D)()```

Now, when editing a Zap in Zapier, you can click the Bookmarklet to go directly to the Zap's History:

screencast

@bmccormack
bmccormack / hide_appointments.js
Created February 12, 2018 15:45
Hide Appointment Events on Google Calendar
// This is really weird. It works, but only after I "inspect element" on an element on the page. I have no idea
// why it doesn't work until I do that. ¯\_(ツ)_/¯ 
document.querySelectorAll('.DPvwYc.H8Utbd').forEach(function(e){console.log(e.parentNode.parentNode.parentNode.style.display='none')})