Skip to content

Instantly share code, notes, and snippets.

View grocky's full-sized avatar

Rocky Gray grocky

View GitHub Profile
#!/usr/bin/env bash
# The various escape codes that we can use to color our prompt.
export RED="\[\033[0;31m\]"
export YELLOW="\[\033[0;33m\]"
export GREEN="\[\033[0;32m\]"
export BLUE="\[\033[0;34m\]"
export LIGHT_RED="\[\033[1;31m\]"
export LIGHT_GREEN="\[\033[1;32m\]"
export WHITE="\[\033[1;37m\]"
export LIGHT_GRAY="\[\033[0;37m\]"
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE:
#! /bin/sh
proxy=$PROXY
if [ "$1" == "on" ]; then
echo "exporting proxy"
export http_proxy=$proxy
export https_proxy=$proxy
@grocky
grocky / find-multiple-classes-in-a-file.sh
Last active August 29, 2015 14:21
PSR-4 Conversion
for i in $(find . -name "*.php" -not -path "./vendor/*"); do
count=$(grep -Ec '(abstract )?(class|interface) [_A-Z][A-Za-z0-9]* ((extends|implements) [_A-Z][A-Za-z0-9]* )*{$' $i);
if [ $count -gt 1 ]; then
echo $i;
fi
done
@grocky
grocky / idea
Last active May 28, 2020 19:13 — forked from chrisdarroch/idea
Open IDEA applications based on project type from the command line!
#!/usr/bin/env bash
IDEA=''
PROJECT_DIR=''
function main() {
openIdea "$@"
}
function openIdea() {
@grocky
grocky / gist:01f58a4ca616ab9932a6
Last active August 29, 2015 14:25
Install ffmpeg
git clone git://source.ffmpeg.org/ffmpeg.git \
&& cd ffmpeg \
&& ./configure \
--disable-debug \
--enable-small \
--extra-libs=-ldl \
--enable-gpl \
--enable-libass \
--enable-libtheora \
--enable-libvorbis \
@grocky
grocky / dash.sh
Created December 2, 2015 23:43
Search documentation in Dash in the terminal
dash () {
open dash://${1}
}
'use strict';
require('coffee-script').register();
var HubotTestHelper = require('hubot-test-helper');
var helper = null;
var RoomUtils = (function() {
function RoomUtils(room) {
this.room = room;
@grocky
grocky / upsource-aws-setup.md
Created April 24, 2016 20:25
Setting up Jebrains Upsource on AWS

Installing and configuring Upsource on AWS with SSL

Upsource is a tool that brings Jetbrains IDE's code insights to code reviews. Upsource's integration with Jetbrains IDEs and GitHub are some of the most attractive features for us at VideoBlocks since we're heavy users of them both. We currently have over 50 private repos and use IntelliJ, PHPStorm and WebStorm to build our core products. All of our infrastructure is hosted on AWS now, so I decided to get this up and running there for quick evaluation.

Launch an EC2 Instance

This step is straight forward and there are already some good resources for setting up an EC2 instance. I won't go into detail here, but I chose an Ubuntu AMI at a size of M3.large (which is the minimum instance size Jetbrains recommends). We're configuring our security group with the standard HTTP ports (80 and 443) and exposing the standard SSH port 22.