Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tsabat's full-sized avatar

Tim Sabat tsabat

View GitHub Profile
@tsabat
tsabat / cp_stats.txt
Created March 29, 2017 16:00
CodePen rails stats, as of Mar 29, 2017
+----------------------+--------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+--------+-------+---------+---------+-----+-------+
| Controllers | 11934 | 9282 | 200 | 1376 | 6 | 4 |
| Helpers | 1406 | 1138 | 0 | 197 | 0 | 3 |
| Models | 5855 | 4515 | 119 | 696 | 5 | 4 |
| Mailers | 701 | 581 | 16 | 61 | 3 | 7 |
| Javascripts | 226460 |134085 | 0 | 13209 | 0 | 8 |
| Libraries | 52 | 38 | 2 | 4 | 2 | 7 |
| Concern specs | 246 | 176 | 2 | 1 | 0 | 174 |

We're testing what happens when you try to update the the image on a global service, placed with constraints.

Prerequisites

  • Install Docker 1.12.2 on ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20160907.1 (ami-746aba14)
  • Add Labels
echo '[Service]\nExecStart=\nExecStart=/usr/bin/dockerd -H fd:// --userns-remap=default --storage-driver aufs --label codepen.service="cpor"' > /etc/systemd/system/docker.service.d/namespaces.conf
systemctl daemon-reload
@tsabat
tsabat / docker-xenial-copy-paste.sh
Last active September 12, 2017 05:31 — forked from BretFisher/docker-xenial-copy-paste.sh
Install Docker PPA on Ubuntu 16.04
# NOT FOR SHELL SCRIPT, but rather just for quick copy paste
# this is a copy-paste version with defaults of full shell script docker-xenial.sh
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \
mkdir -p /etc/apt/sources.list.d && \
echo deb https://apt.dockerproject.org/repo ubuntu-xenial main > /etc/apt/sources.list.d/docker.list && \
service lxcfs stop && apt-get remove -y -q lxc-common lxcfs lxd lxd-client && \
apt-get update -q && apt-get upgrade -y -q && \
apt-get install -y -q linux-image-extra-$(uname -r) linux-image-extra-virtual && \
apt-get install -y -q docker-engine && \

ok, after docker updates, your stuff will break. The fix is to rebuild the stack, which is simple and takes 10s.

JUST DO IT

cd into cp_stack and run the following:

./rebuild_all.sh
function pr () {
local repo=`git remote -v | grep -m 1 "(push)" | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"`
local branch=`git name-rev --name-only HEAD`
echo "... creating pull request for branch \"$branch\" in \"$repo\""
open https://github.com/$repo/pull/new/$branch
}

I use this to list my branches by name. If you want to reusue it, change the grep /ts to grep /yournamespace

function branches() {
  git for-each-ref --sort=-committerdate refs/heads/ | grep /ts | awk '{print $3}' |  sed 's|refs/heads/||g'
}

function branches_all() {
  git for-each-ref --sort=-committerdate refs/heads/ | awk '{print $3}' |  sed 's|refs/heads/||g'
}

viagra

I am a dynamic figure, often seen scaling walls and crushing ice. I have been known to remodel train stations on my lunch breaks, making them more efficient in the area of heat retention. I write award-winning operas, I manage time efficiently.

Occasionally, I tread water for three days in a row. I woo women with my sensuous and godlike trombone playing. I can pilot bicycles up severe inclines with unflagging speed, and I cook 30 minute brownies in 20 minutes.

I am an expert in stucco, a veteran in love, and an outlaw in Peru.

Using only a hoe and a large glass of water, I once single-handedly defended a small village in the Amazon basin from a horde of ferocious army ants. I play bluegrass cello, I was scouted by the Mets. I am the subject of numerous documentaries. When I'm bored, I build large suspension bridges in my yard. I enjoy urban hang gliding. On Wednesdays, after school, I repair electrical appliances free of charge.

I am an abstract artist, a concrete analyst, and a ruthless bookie. Critics w

function delete_current_branch () {
CURR_BRANCH=`git rev-parse --abbrev-ref HEAD`
echo $CURR_BRANCH
if [[ "$CURR_BRANCH" == 'master' ]]; then
echo 'can not delete master branch'
exit 1
fi