Skip to content

Instantly share code, notes, and snippets.

View cp's full-sized avatar
:shipit:

Colby Aley cp

:shipit:
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ColbyAley on github.
  • I am colby (https://keybase.io/colby) on keybase.
  • I have a public key whose fingerprint is 8AB6 87E5 6252 9761 B03E 6929 912F 16C0 5F57 4B51

To claim this, I am signing this object:

# These two approaches are not the same:
class Person2
def self.first_name
full_name.split(' ').first
end
private
def self.full_name
@cp
cp / gist:6f50fb52d3dfbb388060
Created December 9, 2014 22:44
java stack implimentation
class Stack {
private Object[] array;
private int tos = -1;
private int size;
Stack(int size) {
this.size = size;
array = new Object[size];
}
@cp
cp / README.md
Last active December 20, 2015 19:09
Cloudability Shopify Dashboard

Cloudability for Dashing

This is a simple number widget that shows you your current cloud spending for the current month, compared to last month. It is powered by the Cloudability API.

You will need to create and set your Cloudability API key to use this widget. After creating an account, you can obtain an API key here.

Dependencies

This uses the cloudability gem. You will need to add it to your Gemfile and bundle install

@cp
cp / .vimrc
Created October 5, 2013 19:10
syntax on
set tabstop=2
autocmd vimenter * NERDTree
autocmd Vimenter * wincmd p
function! NERDTreeQuit()
redir => buffersoutput
silent buffers
redir END
" 1BufNo 2Mods. 3File 4LineNo
# HAIL RUBY
# My response to https://github.com/JacksonGariety/jesus
# Authentication configured through environment variables, per http://rdoc.info/gems/twitter.
require 'twitter'
require 'teller'
loop do
Twitter.unfollow("JacksonGariety")
@cp
cp / hlog
Created November 15, 2013 07:35
A simple and dirty parser for Heroku Logplex. Not well tested.
#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
require 'terminal-table'
require 'json'
#
# USAGE: `ruby log.rb [HEROKU_APP_NAME]`
#
@cp
cp / email_parser.rb
Created November 19, 2013 04:45
Simple script for taking a CSV of emails and converting it to something Mail.app likes.
require 'csv'
emails = Array.new
text = File.read('emails.csv').gsub(/\\"/,'""')
CSV.parse(text, headers: true, header_converters: :symbol) do |row|
emails << row[:email]
end
puts emails.join(',')
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>ReadIt</title>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
</head>
<body>
<script>
$.ajax({
# This is an example of what a lens may look like.
# It is required by Spectacle when the application is started.
class Twitter < Spectacle::Lens
database do
table do |t|
t.name :tweets
t.text :tweet_content
t.integer :favorites
end