Skip to content

Instantly share code, notes, and snippets.

View BrutalSimplicity's full-sized avatar
💭
Simplicity is hard

Kory Taborn BrutalSimplicity

💭
Simplicity is hard
View GitHub Profile
@mattd
mattd / gist:1006398
Created June 3, 2011 14:12
nginx try_files with a proxy_pass
server {
root /var/www/example.com/static;
server_name example.com;
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
try_files /maintenance.html @proxy;
location @proxy {
proxy_pass http://127.0.0.1:10001;
@gmoothart
gmoothart / xmldiff.cs
Created February 29, 2012 18:17
Xml Diff
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Diagnostics;
namespace ConsoleApplication1
{
class Program
@knmkr
knmkr / get_photos_from_tumblr.py
Created April 21, 2013 18:29
Get photos from my tumblr `likes`.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import urllib
import pytumblr # https://github.com/tumblr/pytumblr
# set yours:
CONSUMER_KEY = ''
@ogrrd
ogrrd / dnsmasq OS X.md
Last active October 16, 2025 11:59
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@korya
korya / Subfolder to git repo.md
Last active August 21, 2025 16:19
Convert subfolder into Git submodule
@uasi
uasi / rebaselock.pre-rebase.sh
Last active February 13, 2023 13:30
A pre-rebase hook that refuses to rebase if "branch.${BRANCH}.rebaselock" is true.
#!/bin/sh
#
# The "pre-rebase" hook is run just before "git rebase" starts doing
# its job, and can prevent the command from running by exiting with
# non-zero status.
#
# The hook is called with the following parameters:
#
# $1 -- the upstream the series was forked from.
# $2 -- the branch being rebased (or empty when rebasing the current branch).
@justinpawela
justinpawela / config
Created August 3, 2016 01:39
AWS CodeCommit Multiple Account Config
# This file is: ~/.ssh/config
# You may have other (non-CodeCommit) SSH credentials stored in this
# config file – in addition to the CodeCommit settings shown below.
# NOTE: Make sure to run [ chmod 600 ~/.ssh/config ] after creating this file!
# Credentials for Account1
Host awscc-account1 # 'awscc-account1' is a name you pick
Hostname git-codecommit.us-east-1.amazonaws.com # This points to CodeCommit in the 'US East' region
@mihow
mihow / load_dotenv.sh
Last active October 20, 2025 01:05
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a
@HyperBrain
HyperBrain / package-plugin-lifecycle.md
Last active November 24, 2023 04:56
Serverless - Package/Deploy plugin lifecycle changes

Overview

Currently the Serverless framework only offers lifecycle events that are bound to commands and also are very coarse. Each core plugin only exposes the events that are defined by the framework. This is suboptimal for plugin authors as they want to hook special events within the deployment process.

The PR adds fine grained lifecycles to the AWS deployment process (see below for the current implementation process) and makes the package/deploy plugin implementation non-breaking.

@HyperBrain
HyperBrain / lifecycle-cheat-sheet.md
Last active September 12, 2025 21:03
Serverless Lifecycle Cheat Sheet

Serverless plugin author's cheat sheet

This cheat sheet provides a detailed overview of the exposed lifecycle events and available commands (and entrypoints) of the Serverless framework, that can be hooked by plugins (internal and external ones). The document is structured by the commands invoked by the user.

Lifecycle events are shown as the globally available outer events (all providers) and sub lifecycle events that are provider specific in the called order. Currently only the AWS provider is shown. If you have information about the other provider,