Skip to content

Instantly share code, notes, and snippets.


Andrew Stilliard stilliard

Block or report user

Report or block stilliard

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
stilliard / scrape.php
Created May 20, 2020
Scrape some blog posts and their images
View scrape.php
// Quickly download some blog posts
// setup:
// mkdir -p images/post-{content,logos} # for images
// mkdir out # for the csv output
// composer init -q
// composer require voku/simple_html_dom
stilliard / index.html.twig
Created Aug 2, 2019
Page sub category lists in REC
View index.html.twig
{% include "html/helpers/sub-categories-list.html.twig" with {'parent': page.products_shown_cat_id } %}
stilliard /
Last active Jul 30, 2019
New ssh user setup via github key

Set newusername as the account name you want the user to have on the server, & newusergithub as that persons github account name. This then takes their public key used with github and allows the user to login to the server via their ssh key.


sudo useradd -m -d /home/$newusername -s /bin/bash $newusername
cd /home/$newusername/
sudo mkdir .ssh
View mod-collection-simple-demo.html.twig
<form method="get">
  <input type="search" name="search" value="{{ | escape }}">
  <button type="submit">Search</button>
  <a href="{{ }}">reset</a>
stilliard / mod-collection-demo.html.twig
Created Jul 10, 2019
module collection demo with tags and search
View mod-collection-demo.html.twig
.mod-tags {}
.mod-tags .active { font-weight: bold; }
<h1>{{ }} Collection</h1>
<form action="{{ }}" method="get">
stilliard / check-for-keys-disabled.sql
Created Feb 24, 2019
Check all database's tables to see if keys are disabled
View check-for-keys-disabled.sql
# Will print database name & tables that have keys disabled
FROM information_schema.STATISTICS
WHERE comment = 'disabled'
stilliard / github-projects-col-widths-userscript.js
Created Jun 5, 2018
Slightly decrease widths of github project board columns
View github-projects-col-widths-userscript.js
// ==UserScript==
// @name Decrease GitHub projects column widths
// @namespace
// @version 0.1
// @description By default the column widths on project boards on github are too big, this decreases them a little
// @author Andrew
// @match*/*/projects/*
// @grant none
// ==/UserScript==
stilliard / github-git-pr-alias
Last active Jun 7, 2018
git alias to show link to create or view pull request for current branch
View github-git-pr-alias
pr = "!f() { git remote get-url origin | sed 's/' | sed 's/.git//g' | awk '{print \"\"$1\"/pull/'$(git rev-parse --abbrev-ref HEAD)'\"}'; }; f"
stilliard /
Last active Nov 20, 2017
nasa apod background - xubuntu / XFCE
# Nasa Image Of The Day As Background
# Originally inspired by
# config
# 2gb example
# ref:
cd /var
touch swap.img
chmod 600 swap.img
dd if=/dev/zero of=/var/swap.img bs=2048k count=1000
mkswap /var/swap.img
swapon /var/swap.img
echo "/var/swap.img none swap sw 0 0" >> /etc/fstab
You can’t perform that action at this time.