Skip to content

Instantly share code, notes, and snippets.

View ssddanbrown's full-sized avatar

Dan Brown ssddanbrown

View GitHub Profile
@ssddanbrown
ssddanbrown / download-random-unsplash-images.sh
Created December 6, 2017 16:45
Get a set of random unsplash images
#!/bin/bash
for i in {1..40}; do wget https://picsum.photos/600/400/\?random -O "$(ls -l | wc -l).jpg"; done
@ssddanbrown
ssddanbrown / custom-head-content.html
Created June 20, 2019 19:56
Hide BookStack Login Form
<style>
form[action$="/login"], form[action$="/login"] + hr {
display: none;
}
form[action$="/login"] + hr + div {
margin-top: 24px;
}
</style>
@ssddanbrown
ssddanbrown / docker-compose.yml
Created March 8, 2020 13:17
BookStack docker-compose windows setup example
---
version: "2"
services:
bookstack:
image: linuxserver/bookstack
container_name: bookstack
environment:
- PUID=1000
- PGID=1000
- DB_HOST=bookstack_db
@ssddanbrown
ssddanbrown / foo.php
Last active May 14, 2020 21:15 — forked from kritschy/foo.php
<?php
// Alter these to your instance, do not share publicly like this.
$base_api_url = 'http://bookstack.local/api/';
$token_id='ZNI62nNoghS3GyfzThlZFXqYNtHdHnM6';
$token_secret='zPffPZ1ATQcv4Nz75QYLEbMm6fPzmo7I';
// Id of the shelf we want to add our book to.
$shelfId = 12; // $_POST["category"]
@ssddanbrown
ssddanbrown / update-bookstack.sh
Last active November 18, 2020 23:23 — forked from codemicro/update-bookstack.sh
Update a BookStack installation while also talking a backup
#!/bin/bash
# BookStack backup & update script
# Forked from codemicro: https://gist.github.com/codemicro/f9dc94ecf5831772e1bff92dfba337d0
########### CONFIG ###########
# Configure this to be the location where BookStack is installed.
# Do not include a trailing slash
BOOKSTACK_DIR="/var/www/bookstack"
@ssddanbrown
ssddanbrown / docker-compose.yml
Created January 16, 2021 11:45
LSIO BookStack & Swag Setup
---
version: "2.1"
services:
swag:
image: ghcr.io/linuxserver/swag
container_name: swag
cap_add:
- NET_ADMIN
environment:
- PUID=1000
@ssddanbrown
ssddanbrown / example.js
Last active February 5, 2021 22:07
Get export-like HTML using the API
// The BASE_URL of your BookStack instance, no trailing slash
const baseUrl = 'http://bookstack.local';
//////////////////
// USAGE EXAMPLE
///
// Get the export content for page ID 4
@ssddanbrown
ssddanbrown / Instructions.md
Last active March 14, 2021 11:57
Visual Studio Code Linux Desktop File

How to use

  1. Follow the linux documentation found here to install Visual Studio Code.
  2. Copy the contents of code.desktop to ~/.local/share/applications/code.desktop
  3. Change /home/dan/Apps/vsc in the code.desktop file to the location you extracted the application to.

This how only been tested by myself on ElementaryOS Freya.

@ssddanbrown
ssddanbrown / game.js
Created March 15, 2015 23:43
Wall Dodge Javascript Game
/**
* Dodge the walls using WAD for movement.
*
* Credit to Mary Rose - https://vimeo.com/105955605
* for the walkthrough
*/
(function() {
var Game = function(canvasId) {
var canvas = document.getElementById(canvasId);
var screen = canvas.getContext('2d');
@ssddanbrown
ssddanbrown / functions.php
Created June 28, 2021 19:42
BookStack root URI page search via theme functions file
<?php
use BookStack\Entities\Models\Page;
use BookStack\Theming\ThemeEvents;
use BookStack\Facades\Theme;
use Illuminate\Http\Request;
// This will be the content of the functions.php file you'll have
// after following the getting started instructions here:
// https://github.com/BookStackApp/BookStack/blob/release/dev/docs/logical-theme-system.md