Skip to content

Instantly share code, notes, and snippets.

View pauljacobson's full-sized avatar
:octocat:

Paul Jacobson pauljacobson

:octocat:
View GitHub Profile
@scripting
scripting / systemScript.ftsc
Last active September 29, 2017 20:05
Example of the kind of code I routinely write for system scripting
local (sourcefolder = user.prefs.dropboxfolder + "public:misc:nodeeditor:fargo.io-code-publisher:");
local (githubfolder = user.prefs.githubfolder + "fargoPublisher:");
local (montaukfolder = user.prefs.dropboxfolder + "montauk:fargopub:");
on copyone (f1, f2) {
file.surefilepath (f2);
try {
if file.readwholefile (f1) != file.readwholefile (f2) {
file.copy (f1, f2)
}
@robvolk
robvolk / es6_fetch_example.js
Last active October 17, 2019 16:46
AJAX requests in ES6 using fetch()
// ES6 Fetch docs
// https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
fetch('https://some.url.com')
.then(response => {
if (response.ok) {
return Promise.resolve(response);
}
else {
return Promise.reject(new Error('Failed to load'));
@jessestu
jessestu / screen-sharing-help.md
Last active October 30, 2019 19:36
WordPress.com screen sharing: help and policies

You scheduled a one-to-one screen sharing session with me to get help with your WordPress.com site. Wonderful!

Here's a list of potential issues and fixes and what to do if you can't make the meeting so a no-show or technical difficulties don't result in our policy enforcement (does anyone like enforcing policies? I sure don't!).

Cat sharing computer screen
I expect this kitty is using WordPress.com.

Index

@stolinski
stolinski / keybindings.json
Created June 21, 2017 23:10
VSCode Tab Switching Keybindings
[
{ "key": "ctrl+1", "command": "workbench.action.focusFirstEditorGroup" },
{ "key": "ctrl+2", "command": "workbench.action.focusSecondEditorGroup" },
{ "key": "ctrl+3", "command": "workbench.action.focusThirdEditorGroup" },
{ "key": "cmd+1", "command": "workbench.action.openEditorAtIndex1" },
{ "key": "cmd+2", "command": "workbench.action.openEditorAtIndex2" },
{ "key": "cmd+3", "command": "workbench.action.openEditorAtIndex3" },
{ "key": "cmd+4", "command": "workbench.action.openEditorAtIndex4" },
{ "key": "cmd+5", "command": "workbench.action.openEditorAtIndex5" },
{ "key": "cmd+6", "command": "workbench.action.openEditorAtIndex6" },
// ==UserScript==
// @name Zendesk Plus
// @namespace https://wpcomhappy.wordpress.com/
// @icon https://raw.githubusercontent.com/soufianesakhi/feedly-filtering-and-sorting/master/web-ext/icons/128.png
// @version 1.0
// @description Tool for enhancing Zendesk
// @author Siew "@xizun"
// @match https://woothemes.zendesk.com/*
// @grant GM_setClipboard
// @require http://code.jquery.com/jquery-3.4.1.min.js
# To prevent the vulnerable server from running on your machine
# (this does not impact Zoom functionality), run these two lines in your Terminal.
pkill "ZoomOpener"; rm -rf ~/.zoomus; touch ~/.zoomus && chmod 000 ~/.zoomus;
pkill "RingCentralOpener"; rm -rf ~/.ringcentralopener; touch ~/.ringcentralopener && chmod 000 ~/.ringcentralopener;
# (You may need to run these lines for each user on your machine.)
@derekkwok
derekkwok / encode.py
Last active December 5, 2020 12:14
Simple python script to encode videos using ffmpeg
"""
This python script encodes all files that have the extension mkv in the current
working directory.
Sources:
http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide
"""
import subprocess, os
#-------------------------------------------------------------------------------
@philipbl
philipbl / import.py
Created August 15, 2012 22:57
Imports Evernote HTML into DayOne
from optparse import OptionParser
from HTMLParser import HTMLParser
import os
import glob
import sys
import re
class Entry():
def __init__(self):
self.tags = []
@TheFrostlixen
TheFrostlixen / batch_ren.py
Last active May 17, 2021 10:37
Python script to batch rename files via regex
import glob, os
# point path to directory containing the shows
# load episode titles into `ep.txt`
path = r"I:\Videos\show"
new_filenames = []
with open(path + '\\ep.txt', 'r') as f:
for line in f:
new_filenames.append(line)
@dvirsky
dvirsky / gendocs.py
Last active September 12, 2021 16:12
Generate Markdown documentation from a python package
# This script generates mkdocs friendly Markdown documentation from a python package.
# It is based on the the following blog post by Christian Medina
# https://medium.com/python-pandemonium/python-introspection-with-the-inspect-module-2c85d5aa5a48#.twcmlyack
import pydoc
import os, sys
module_header = "# Package {} Documentation\n"
class_header = "## Class {}"
function_header = "### {}"