Skip to content

Instantly share code, notes, and snippets.

View johnnycrich's full-sized avatar
👋

Johnny Richardson johnnycrich

👋
View GitHub Profile
@johnnycrich
johnnycrich / docker-compose.yml
Last active October 20, 2021 15:58
GhostJS/Nginx Docker compose
version: '3'
services:
codesign:
image: ghost
restart: always
environment:
url: https://codesign.elab.emerson.edu
community:
image: ghost
@johnnycrich
johnnycrich / ssl.conf
Last active March 18, 2019 14:33
SSL config for elab web apps (2019)
ssl_dhparam /etc/ssl/certs/dhparam.pem;
ssl_protocols TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
ssl_session_cache shared:SSL:50m;
ssl_session_timeout 5m;
ssl_stapling on;
ssl_stapling_verify on;
@johnnycrich
johnnycrich / keybase.md
Created February 14, 2019 15:33
Keybase Proof

Keybase proof

I hereby claim:

  • I am johnnycrich on github.
  • I am johnnycrich (https://keybase.io/johnnycrich) on keybase.
  • I have a public key ASCrx2cxXWkogMWLyffwG2YuGQDx_--ohDZa9ZpD4paRggo

To claim this, I am signing this object:

@johnnycrich
johnnycrich / angular.conf.j2
Created January 28, 2019 19:55
Angular nginx config to rule them all (Ansible template)
# {{ ansible_managed }}
{% set item = (nginx_default_sites['default'] | combine(app, recursive=True)) %}
server {
# For legacy agent detect
set $legacy_browser 0;
listen {{ item.listen_http }}{{ ' default deferred' if item.default_server else '' }};
@johnnycrich
johnnycrich / nginx-outdated.conf
Last active January 16, 2019 17:21
Nginx config map for outdated/unsupported user agent
map $http_user_agent $outdated {
default 0;
"~MSIE [0-9]\." 1;
"~MSIE 10*" 1;
"~rv:11*" 1;
"~Mozilla.*Firefox/[1-9]\." 1;
"~Mozilla.*Firefox/[0-4][0-9]\." 1;
"~Mozilla.*Firefox/5[0-2]\." 1;
"~Opera.*Version/[0-9]\." 1;
"~Opera.*Version/[0-4][0-9]\." 1;

EL Web SDK module setup:

  1. Install el-web-sdk locally and carefully follow all README instructions.
  2. Clone one of the repos intended as an Web SDK module, or the starter-module repo.
  3. Link the module you cloned to el-web-sdk (where cloned-repo is the name of the repo cloned):
cd cloned-repo
npm link
@johnnycrich
johnnycrich / project-name.sublime-project
Created February 2, 2017 16:24
Sublime Text 3 project file template for el-web-sdk/learnining-games projects
{
"folders":
[
{
"name": "Client",
"path": "public/js"
},
{
"name": "Library",
"path": "lib"
@johnnycrich
johnnycrich / generate-docs-from-spreadsheet.js
Last active August 7, 2016 20:39
A Google Apps script that generates a Google Doc using a base template for every row in the sheet, using the first row as the questions that the following ones respond to. I used this to create docs containing curator responses for the Boston Festival of Indie Games 2016.
function generateDocs() {
var template = DriveApp.getFileById('--template-id-here--');
var sheet = SpreadsheetApp.getActiveSheet();
var data = sheet.getDataRange().getValues();
data[0].shift();
data[0].shift();
var questions = data[0];
@johnnycrich
johnnycrich / nginx-site-sample
Last active October 29, 2016 22:27
Sample nginx configuration
# Reverse proxy config for app server
# Based partially on: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-14-04
# App running on port 8000)
server {
listen 80;
server_name www.domain.org domain.org;
var $asm00 = JSIL.GetAssembly("48eadcc1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null");
var $asm01 = JSIL.GetAssembly("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
var $sig = new JSIL.MethodSignatureCache();
/* Generated by JSIL v0.5.1 build 27572. See http://jsil.org/ for more information. */
var $asm00 = JSIL.DeclareAssembly("48eadcc1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null");
JSIL.MakeStaticClass("Program", true, [], function ($) {
$.Method({Static:true , Public:true }, "Main",