Skip to content

Instantly share code, notes, and snippets.

@ssddanbrown
ssddanbrown / export-books.php
Last active Mar 16, 2022
BookStack-Export-Books
View export-books.php
#!/usr/bin/env php
<?php
// API Credentials
// You can either provide them as environment variables
// or hard-code them in the empty strings below.
$apiUrl = getenv('BS_URL') ?: ''; // http://bookstack.local/
$clientId = getenv('BS_TOKEN_ID') ?: '';
$clientSecret = getenv('BS_TOKEN_SECRET') ?: '';
@ssddanbrown
ssddanbrown / docker-compose.yml
Created Mar 8, 2020
BookStack docker-compose windows setup example
View docker-compose.yml
---
version: "2"
services:
bookstack:
image: linuxserver/bookstack
container_name: bookstack
environment:
- PUID=1000
- PGID=1000
- DB_HOST=bookstack_db
View custom-head-content.html
<style>
form[action$="/login"], form[action$="/login"] + hr {
display: none;
}
form[action$="/login"] + hr + div {
margin-top: 24px;
}
</style>
@ssddanbrown
ssddanbrown / download-random-unsplash-images.sh
Created Dec 6, 2017
Get a set of random unsplash images
View download-random-unsplash-images.sh
#!/bin/bash
for i in {1..40}; do wget https://picsum.photos/600/400/\?random -O "$(ls -l | wc -l).jpg"; done
@ssddanbrown
ssddanbrown / docker-compose.yml
Created Oct 6, 2017
BookStack Docker Compose Dev
View docker-compose.yml
version: '3'
services:
web:
image: "ssddanbrown/docker-ubuntu-php7"
ports:
- "8080:8080"
depends_on:
- "database"
volumes:
- ./:/app
@ssddanbrown
ssddanbrown / subl.js
Created Aug 22, 2017
Sublime Text Project Manager Script
View subl.js
#!/usr/bin/env node
// Imports
const fs = require('fs');
const path = require('path');
const exec = require('child_process').exec;
// Config
const storeFolder = path.join(process.env.HOME, '.config/sublime-projects');
const sublimePath = '/opt/sublime_text/sublime_text'
View gist:1223a875b7ed0cc64e15b5afe0b10699
curl -L https://github.com/ssddanbrown/haste/releases/download/v0.2.2/haste-osx-amd64 > haste && chmod a+x haste && sudo mv haste /usr/bin/haste
@ssddanbrown
ssddanbrown / bookstack-nginx-proxy-conf
Last active Aug 20, 2016
BookStack url sub-path config
View bookstack-nginx-proxy-conf
# This sets the name 'bookstack' to point locally on port 3002
# and is used on line 19 below.
upstream bookstack { server 127.0.0.1:3002; }
# This is the main server setup that users access
# If you have existing sites and you are adding bookstack on a
# 'subdirectory' you may have to combine this with your existing configuration.
server {
listen 80;
# If copying this whole section you will have to change this to your domain or IP.
@ssddanbrown
ssddanbrown / gist:0720705f9e8af9af5a83
Created Mar 6, 2016
Docker maria db BookStack Testing Command
View gist:0720705f9e8af9af5a83
docker run --name mariadb -p 127.0.0.4:6060:3306 -e MYSQL_ROOT_PASSWORD=bookstack -e MYSQL_DATABASE=bookstack -e MYSQL_USER=bookstack -e MYSQL_PASSWORD=bookstack -d mariadb:latest
@ssddanbrown
ssddanbrown / trello-style-overrides.css
Last active Jun 3, 2016
Trello dark theme style overrides
View trello-style-overrides.css
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v15/CWB0XYA8bzo0kSThX0UTuA.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
body {
background-size:cover !important;