Skip to content

Instantly share code, notes, and snippets.

View ryan-blunden's full-sized avatar

Ryan Blunden ryan-blunden

  • Brisbane, Australia
View GitHub Profile
@ryan-blunden
ryan-blunden / post_gen.py
Last active July 24, 2019 21:00
GopherCon 2019 data and post generation script
import json
from slugify import slugify
TEMPLATE = '''---
title: "GopherCon 2019 - {session}"
description: "{description}"
author: $LIVEBLOGGER_NAME for the GopherCon 2019 Liveblog
publishDate: {date}T00:00-{time}
tags: [
gophercon
@ryan-blunden
ryan-blunden / repos.jsonc
Created June 4, 2019 21:01
Good mix of repositories for testing a Sourcegraph instance
{
"repos": [
"sourcegraph/sourcegraph", // Mix
"sourcegraph/deploy-sourcegraph", // YAML
"jenkinsci/jenkins", // Java
"getsentry/sentry", // Python
"moby/buildkit", // Go
"pallets/flask", // Python
"googleapis/gapic-generator", // Java
"Azure/azure-storage-js", // TypeScript
@ryan-blunden
ryan-blunden / nginx.conf
Created May 13, 2019 19:42
NGINX conf for lang servers with basic auth
# This config was generated by Sourcegraph.
# You can adjust the configuration to add additional TLS or HTTP features.
# Read more at https://docs.sourcegraph.com/admin/nginx
error_log stderr;
pid /var/run/nginx.pid;
# Do not remove. The contents of sourcegraph_main.conf can change between
# versions and may include improvements to the configuration.
include nginx/sourcegraph_main.conf;
@ryan-blunden
ryan-blunden / docker-compose.yml
Created May 13, 2019 19:39
Docker Compose for lang servers
version: '3'
services:
sourcegraph:
container_name: sourcegraph
image: sourcegraph/server:3.2.0
environment:
- SRC_LOG_LEVEL=dbug
ports:
- '127.0.0.1:80:80'
- 443:7080
@ryan-blunden
ryan-blunden / generate_sourcegraph_docs_nav.py
Last active May 3, 2019 19:35
WIP Python script for generating the nav for docs.sourcegraph.com. Once fully baked, it will be ported to Go and greatly improved.
#!/usr/bin/env python3
from __future__ import annotations
from dataclasses import dataclass, field
import inspect
import os
import re
import sys
from typing import List
@ryan-blunden
ryan-blunden / commands.sh
Last active March 27, 2019 22:58
Sourcegraph with language servers behind SSL with basic auth
# Execute settings to insert lang server settings
docker container exec sourcegraph /bin/bash -c 'cat /var/opt/sourcegraph/settings_init.sql | psql -U postgres sourcegraph'
# Execute psql commands
docker container exec sourcegraph /bin/bash -c 'echo "SELECT * FROM settings;" | psql -U postgres sourcegraph'
#!/usr/bin/env bash
# usage (requires fswatch): `fswatch -o . | xargs -n1 -I{} ./bin/hot-reload.sh`
# usage (requires fsevents-tools): `while true; do notifywait ~/Projects/docsite; ./update.sh; done`
killall docsite
cd cmd/docsite
go get
cd -
docsite -config "../sourcegraph/doc/docsite.json" serve
#! /usr/bin/env bash
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ~/.sourcegraph/config/sourcegraph.key -out ~/.sourcegraph/config/sourcegraph.crt -subj "/CN=localhost
/**
* Placeholder for required styles to correctly render exported Mermaid SVG files from the online live editor
*/
/* Number in below styles is unique for each export */
#mermaid-1551921004212 .label {
font-family: 'trebuchet ms', verdana, arial;
color: #333;
font-size: 14px;
@ryan-blunden
ryan-blunden / docker-compose.yml
Last active February 25, 2019 21:40
Docker Compose example for Sourcegraph with the Go language server
version: "3"
services:
sourcegraph:
image: sourcegraph/server:3.1.1
environment:
- SRC_LOG_LEVEL=dbug
ports:
- 80:7080
- 443:7080
- 2633:2633