Skip to content

Instantly share code, notes, and snippets.

View themightychris's full-sized avatar

Chris Alfano themightychris

View GitHub Profile
@themightychris
themightychris / users.toml
Created August 25, 2020 19:44
Slate gitsheets schema
[gitsheet]
root = "users"
path = "${{ id > 0 ? Math.floor(id/1000)*1000 || '0000' : 'pending' }}/${{ id }}"
[gitsheet.fields.id]
default = -1
[gitsheet.fields.contact_points]
sort = [ 'id == null', 'slot', 'id', 'kind', 'label', 'data' ]
@themightychris
themightychris / README.md
Last active July 27, 2020 14:19
Emergence: Backup to B2 via Restic
@themightychris
themightychris / test-organizations.json
Last active March 25, 2020 12:48
CfAPI test organizations
[
{
"name": "Code for Philly",
"website": "https://codeforphilly.org",
"events_url": "https://www.meetup.com/Code-for-Philly/",
"rss": "http://codeforphilly.org/project-updates?format=rss",
"projects_list_url": "http://codeforphilly.org/projects.csv",
"city": "Philadelphia, PA",
"latitude": "39.9523",
"longitude": "-75.1638",
@themightychris
themightychris / README.md
Last active January 27, 2020 06:04
De-parent an emergence site

Prepare vfs-site projection

Optionally, begin the vfs-site projection branch with a snapshot of the legacy VFS:

emergence-source-http-legacy pull mysite.example.org

# using tree hash output at end of pull command
TREE_HASH=4b825dc642cb6eb9a060e54bf8d69288fbee4904
git commit-tree -m "snapshot mysite.example.org" "${TREE_HASH}"
@themightychris
themightychris / default.toml
Created October 22, 2019 20:45
Habitat composite plan
[services.postgresql]
pkg_ident = "core/postgresql11"
[services.myapp]
pkg_ident = "myorigin/myapp"
[services.myapp.binds]
database = "postgresql"
[services.nginx]
pkg_ident = "emergence/nginx"
@themightychris
themightychris / config--env
Created October 22, 2019 20:40
Habitat plan.sh for Laravel application
#!{{pkgPathFor "core/bash"}}/bin/bash -e
if [ -f '{{pkg.svc_var_path}}/key' ]; then
APP_KEY="$(cat '{{pkg.svc_var_path}}/key')"
fi
APP_DEBUG='{{#if cfg.app.debug}}true{{/if}}'
APP_ENV='{{#if cfg.app.env}}{{cfg.app.env}}{{else}}production{{/if}}'
APP_URL='{{cfg.app.url}}'
@themightychris
themightychris / Dockerfile
Created September 24, 2019 22:55
nginx + PHP composite Docker container
#
# Multi-Stage Docker build:
# Laravel 5.8 + PHP73 + Postgres || MySQL
#
# @link https://laravel.com/docs/5.8
# @link https://hub.docker.com/_/php
# @link https://hub.docker.com/_/mysql
# @link https://hub.docker.com/_/postgres
#
@themightychris
themightychris / slate-columns.php
Created August 13, 2019 21:40
Slate default importer columns
class AbstractSpreadsheetConnector
{
// column maps
public static $studentColumns = [
'Key' => 'ForeignKey',
'School ID Number' => 'StudentNumber',
'Student ID' => 'StudentNumber',
'Username' => 'Username',
'Password' => 'Password',
'Email' => 'Email',
@themightychris
themightychris / .gitignore
Created February 28, 2019 22:44
habitat studio starter: python / django app
.venv/
@themightychris
themightychris / README.md
Created February 8, 2019 00:56
File watch notifications with Docker for Windows

A workaround is needed to make file change notification work under Docker for Windows:

# install Python via Chocolatey
choco install python

# install workaround Python script via PIP
pip install docker-windows-volume-watcher

# activate watch mode for all running Docker containers