Skip to content

Instantly share code, notes, and snippets.

View briceburg's full-sized avatar

Brice Burgess briceburg

  • toil over toil
  • albuquerque, nm
View GitHub Profile
@briceburg
briceburg / gist:231e8c4feeea986ed2be
Created August 10, 2015 21:45
portable realpath with gnu readlink / coreutils
type greadlink >/dev/null 2>&1 && CWD="$(dirname "$(greadlink -f "$0")")" || \
CWD="$(dirname "$(readlink -f "$0")")"
@briceburg
briceburg / app.js
Created September 30, 2015 03:47
expressjs + passport + github oauth2 + github membership verification
// app
var passport = require('passport');
var GitHubStrategy = require('passport-github').Strategy;
var request = require('request');
// middleware
passport.use(new GitHubStrategy({
clientID: app.locals.GITHUB_CLIENT_ID,
clientSecret: app.locals.GITHUB_CLIENT_SECRET,
callbackURL: "http://localhost:8888/login/github/callback",
@briceburg
briceburg / AppServiceProvider.php
Last active July 20, 2019 07:55
laravel 5 - configuring minimal log level
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Log;
use Config;
class AppServiceProvider extends ServiceProvider
{
@briceburg
briceburg / Dockerfile
Last active August 21, 2021 06:02
laravel 5 - running in a docker container
FROM alpine
ENV \
APP_DIR="/app" \
APP_PORT="80"
# the "app" directory (relative to Dockerfile) containers your Laravel app...
COPY app/ $APP_DIR
RUN apk add --update \
@briceburg
briceburg / default.conf
Created November 6, 2015 20:59
nginx | test configurations in docker
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
@briceburg
briceburg / git.md
Created November 22, 2015 05:42
git - checking fast-forward-ness
git merge-base --is-ancestor master HEAD

from man git merge-base

A common idiom to check "fast-forward-ness" between two commits A and B is (or at least used to be) to compute the merge base between A and B, and check if it is the same as A, in which case, A is an ancestor of B. You will see this idiom used

@briceburg
briceburg / sed_inplace.sh
Last active January 28, 2016 19:53
sed_inplace - osx/linux sed in place editing -- sed in line editing
# subst_inplace : in place file substitution
############################################
#
# usage: sed_inplace "file" "sed substitution"
# ex: sed_inplace "/tmp/file" "s/CLIENT_CODE/BA/g"
#
sed_inplace(){
# linux
local SED_CMD="sed"
@briceburg
briceburg / debian-lamp.md
Last active January 14, 2016 18:05
debian lamp server setup
@briceburg
briceburg / README.md
Created January 8, 2016 18:37
continuous improvement

continuous improvement

what the move to webroot/ allowed

  • repo becomes authoritative source of versioned information for running an application
    • mockups
    • documentation
    • application configuration
  • skel
@briceburg
briceburg / debian-lamp.yml
Created January 14, 2016 18:04
automated [ansible] debian lamp server setup
---
# based on https://gist.github.com/briceburg/ded5e82a70e5af71a611
- name: common utilities
apt:
name: "{{ item }}"
state: present
update_cache: yes
cache_valid_time: 3600