Skip to content

Instantly share code, notes, and snippets.

@svx
svx / confluence_export.sh
Created July 22, 2021 09:43 — forked from Lixivial/confluence_export.sh
shell script to output all Confluence spaces to PDF (and HTML) and place them on a share.
#!/bin/bash
# set -x
# Jesse Pearson
# Shell script to output all Confluence Spaces to PDF and optionally
# push them to a SMB or some other share.
#
# Dependencies:
# wget
#
# Optional dependencies:
@svx
svx / Vagrantfile
Created July 20, 2021 08:56 — forked from niw/Vagrantfile
A simple Vagrantfile to setup Ubuntu desktop environment with Google Chrome and Japanese input
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.provider :virtualbox do |v|
v.gui = true
v.memory = 2048
end
# Currently "ubuntu/bionic64" on VirtualBox requires `type: "virtualbox"`
# to make synced folder works.
@svx
svx / generateSchema.js
Created March 31, 2021 09:07 — forked from jsjaspreet/generateSchema.js
Generate GraphQL Schema and Docs programmatically (adopted from Relay github)
import fs from 'fs';
import path from 'path';
import { graphql } from 'graphql';
import { introspectionQuery } from 'graphql/utilities';
import schema from './src/schema/index';
(async () => {
const result = await graphql(schema, introspectionQuery);
if (result.errors) {
console.error(
@svx
svx / nginx.conf
Created May 27, 2020 08:17 — forked from sergejmueller/nginx.conf
Stop search engines from indexing .txt, .log, .xml, .css and .js files in Nginx
location ~* \.(txt|log|xml|css|js)$ {
add_header X-Robots-Tag noindex;
}
@svx
svx / sane-caching.nginx.conf
Created May 26, 2020 13:01 — forked from philipstanislaus/sane-caching.nginx.conf
Sample Nginx config with sane caching settings for modern web development
# Sample Nginx config with sane caching settings for modern web development
#
# Motivation:
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools.
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh
# and juicy version of your assets available.
# At some point, however, you want to show your work to testers, your boss or your client.
# After you implemented and deployed their feedback, they reload the testing page – and report
# the exact same issues as before! What happened? Of course, they did not have developer tools
# open, and of course, they did not empty their caches before navigating to your site.
@svx
svx / cache-warmer.sh
Created May 25, 2020 12:27 — forked from AJMaxwell/cache-warmer.sh
A quick bash script I wrote to prime the cache of all my websites. This script grabs the sitemap of the site you wish to warm, then grep the urls to wget each one to cache it on the server.
#!/bin/bash
#####################################################################################################
# Cache Warmer
#
# Useage: cache-warmer.sh ...args
#
# This script grabs the sitemap of the site you wish to warm, then grep the urls to wget each one
# to cache it on the server. I'm sure there are better ways to do this, but this was a simple enough
# method for my needs. I didn't want to have to type in the urls each time I warmed their cache, so
# I just made simple functions with short names to feed those urls into the cache warming function.
{
"name": "aws-amplify-documentation",
"version": "1.0.0",
"description": "AWS Amplify Documentation",
"main": "index.md",
"dependencies": {},
"devDependencies": {
"broken-link-checker": "^0.7.8",
"markdown-spellcheck": "^1.3.1",
"write-good": "^0.13.1"
@svx
svx / gist:096473518d1a6a2e4019071ee7fc1b22
Created February 26, 2020 13:02
spectral-rules.yml
extends: [[spectral:oas, all]]
rules:
# Default spectral OAS rules
# https://stoplight.io/p/docs/gh/stoplightio/spectral/docs/reference/openapi-rules.md
oas3-unused-components-schema: false
operation-default-response: false
# Custom rules
tag-descriptions:
description: Tags must have a description.
given: $.tags[*]
@svx
svx / gitget.py
Created February 12, 2020 09:58 — forked from divs1210/gitget.py
Download a specific folder from a github repo
#!/usr/bin/python
"""
Download a specific folder from a github repo:
gitget.py https://github.com/divs1210/kilvish/tree/master/examples/bricksnball
"""
__author__ = 'Divyansh Prakash'
import sys
import subprocess
@svx
svx / gist:75dc081c0464c1ac8b81092eef7e214a
Created January 29, 2020 16:25 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1