Skip to content

Instantly share code, notes, and snippets.

@kylemclaren
kylemclaren / Bashful
Last active December 21, 2015 22:39
This is my current Mac OS X bash profile. It formats the prompt nicely, makes it easy to read and throws in some handy features and a few nice aliases for Homebrew commands.
# ~/.bash_profile
# Git branch in prompt. From https://github.com/jimeh/git-aware-prompt/
export GITAWAREPROMPT=~/.bash/git-aware-prompt
source $GITAWAREPROMPT/main.sh
# Nicely formats prompt. Current directory path, current git branch then "$" on a fresh line
# $git_dirty verifies if changes are commited or not
@kylemclaren
kylemclaren / gist:9134403
Created February 21, 2014 13:40
(ERROR) bundle exec rails g locomotive:install
/usr/local/var/rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/activesupport-3.2.16/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- compass-rails (LoadError)
from /usr/local/var/rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/activesupport-3.2.16/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/local/var/rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/activesupport-3.2.16/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/local/var/rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/activesupport-3.2.16/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/var/rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.4.1/lib/locomotive/dependencies.rb:29:in `<top (required)>'
from /usr/local/var/rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.4.1/lib/locomotive/engine.rb:1:in `require'
from /usr/local/var/rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.4.1/lib/locomotive/engin
#!/usr/bin/ruby
# script to compare and see what lines are in file1 but not file2
f1 = File.open('file1.txt')
f2 = File.open('file2.txt')
file1lines = f1.readlines
file2lines = f2.readlines
#!/usr/bin/ruby
=begin
Usage: rtftomarkdown.rb FILENAME.rtf
Uses textutil, available on Mac only (installed by default)
Outputs to STDOUT
Notes:
Links are replaced with Markdown references (duplicate links combined).
#!/bin/sh
# any2pandoc.sh
#
# A shell script that tries its best to convert documents thrown at it
# to pandoc's extended markdown.
#
# https://gist.github.com/1181510
#
# Depends on:
require 'rubygems'
require 'aws/s3'
# Change the access key and secret to your amazon credentials
AWS::S3::Base.establish_connection!(
:access_key_id => 'ACCESS_KEY_ID',
:secret_access_key => 'SECRET'
)
# Change this to your S3 bucket name
WEBSITE_BUCKET_NAME = "YOUR_BUCKET_NAME"
METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@kylemclaren
kylemclaren / gist:3507f4867d6f55360e39
Created July 11, 2014 13:26
Quick Command-Line Speedtest
$ pip install speedtest-cli
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.deb
sudo dpkg -i elasticsearch-1.1.1.deb