Skip to content

Instantly share code, notes, and snippets.

@cayleyh
cayleyh / install-comodo-ssl-cert-for-nginx.rst
Created June 1, 2020 19:23 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@cayleyh
cayleyh / bookmarklet.js
Last active September 8, 2017 21:03
Bookmarklet: Delete Old Files From Slack
javascript:(function()%7B(function()%20%7B%2F*%20check%20for%20slack%20*%2Fif(!window.TS)%20return%20alert('Not%20on%20slack.com..%3F')%3B%2F*%20files%20older%20than%2060%20days%20*%2Fconst%20days%20%3D%2060%3Bfunction%20getFiles()%20%7Blet%20types%20%3D%20'all'%3Blet%20page%20%3D%201%3B%2F*%20unix%20timestamp%20*%2Flet%20ts_to%20%3D%20Math.round(%20(Date.now()%20-%20(days%20*%2024%20*%2060%20*%2060%20*%201000))%20%2F%201000%20)%3Breturn%20new%20Promise((res%2C%20err)%20%3D%3E%20%7BTS.api.call('files.list'%2C%20%7Btypes%2Cuser%3A%20boot_data.user_id%2Cts_to%3A%20ts_to%2Cpage%7D%2C%20(a%2C%20data)%20%3D%3E%20%7Bres(data)%3B%7D)%3B%7D)%3B%7D%3B%2F*%20promise%20wrapper%20for%20delete%20api%20*%2Ffunction%20deleteFile(file)%20%7Breturn%20new%20Promise((res%2C%20err)%20%3D%3E%20%7BTS.api.call('files.delete'%2C%20%7Bfile%3A%20file.id%7D%2C%20()%20%3D%3E%20%7B%2F*%20ignoring%20errors%20left%20%26%20right%20*%2Fres()%3B%7D)%3B%7D)%3B%7D%3Bfunction%20deleteBatches(files)%20%7Bif(files.length%20%3D%3D%3D%200)%20return%
@cayleyh
cayleyh / gist:7aef5a7314225b031ea96368b6788b7f
Last active April 27, 2019 22:10
Simple bookmarklet to make Apple Docs, Wikipedia, etc. more readable
javascript:(function()%7Bvar%20css%20%3D%20'%23contents%2C%20%23bodyContent%2C%20.main.section%2C%20section%20%7Bmax-width%3A%2036em%3B%20margin%3A%201em%20auto%3B%20font-size%3A%20125%25%3B%7D%20p%20%7B%20line-height%3A%201.5em%3B%20%7D'%2Chead%20%3D%20document.head%20%7C%7C%20document.getElementsByTagName('head')%5B0%5D%2Cstyle%20%3D%20document.createElement('style')%3Bstyle.type%20%3D%20'text%2Fcss'%3Bif%20(style.styleSheet)%7Bstyle.styleSheet.cssText%20%3D%20css%3B%7D%20else%20%7Bstyle.appendChild(document.createTextNode(css))%3B%7Dhead.appendChild(style)%7D)()