Skip to content

Instantly share code, notes, and snippets.

@leonson
leonson / sample_workflow.yml
Created July 19, 2020 04:06
Sample Workflow
on:
push:
branches:
- master
jobs:
deploy-to-digital-ocean-droplet:
runs-on: ubuntu-latest
name: Deploy Website
steps:
@leonson
leonson / unpublish.py
Created December 9, 2018 01:29
Used this script to unpublish all jekyll posts before a particular year
import os
PATTERN = "author: leonson"
YEAR = 2012
def unpublish(filepath, pattern):
file_handle = open(filepath, "r")
contents = file_handle.readlines()
file_handle.close()
index = 0
# Inspired by https://gist.github.com/saikatbhadra/6629031
import mechanize
from bs4 import BeautifulSoup
from datetime import datetime
import random
import time
TGT_DATE = 'April 21, 2015' #i.e. 'September 30, 2014'
OFFICE_ID = '548' # officeid for RWC DMV. See HTML code for other office ids