Skip to content

Instantly share code, notes, and snippets.

View peterkappus's full-sized avatar

Peter Kappus peterkappus

View GitHub Profile
@peterkappus
peterkappus / .gitignore
Created July 3, 2017 21:56
Dockerised Rails Development Environment (take 1)
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Ignore bundler config.
/.bundle
# Ignore all logfiles and tempfiles.
@peterkappus
peterkappus / how_i_make_rails_apps.md
Last active June 30, 2017 16:22
A regularly updated file on how I make rails apps.

How I make rails apps

This is a quick step-by-step guide for how I've made my latest rails app. Check the edit date to know when it was updated. Duh. ;)

Run it on Heroku

It’s just easier... Who needs to mess with devops these days.

  • Create an account at heroku.com
  • Install the Heroku command line tools on your machine

Get your machine ready

@peterkappus
peterkappus / rails_app_starter_2016.md
Last active November 20, 2016 13:17
How I've been making rails apps in 2016

How I make rails apps in 2016

This is a quick step-by-step guide for how I've been getting quick proof-of-concept rails apps up and running in 2016. Mostly for my own reference. Feedback welcome :)

Run it on Heroku

It’s just easier... Who needs to mess with devops in 2016?

  • Create an account at heroku.com
  • Install the Heroku command line tools on your machine
@peterkappus
peterkappus / month_to_quarter.txt
Created November 14, 2016 11:59
Convert month number to financial quarter (e.g. month 3 => quarter 4; month 10 => quarter 3)
(((month_num+8)%12)*4/12)+1
@peterkappus
peterkappus / publishDataToSheets.gs
Last active August 25, 2016 13:54
Loop through a list of sheet URLs and publish data from a central sheet into new tabs on each child sheet.
/*
Copy ALL finance actuals to each team forecast sheet so they can be used to show actuals in graphs, etc and assist forecasting.
*/
//source actuals sheet (from our Report master)
var source_sheet_doc = SpreadsheetApp.openById("XXXXXXX");
@peterkappus
peterkappus / updateActuals.gs
Created August 25, 2016 12:50
Hunt for finance actuals in the source sheet, process, re-format, and save to destination actuals sheet.
var source_sheet_doc = SpreadsheetApp.openById("XXXXX");
var destination_doc = SpreadsheetApp.openById("XXXXXX");
// How many months of actuals do we have?
// NOTE: Update this monthly as new actuals are available.
var months_of_actuals = 4;
// which column should we search for the trigger?
// NOTE: if the finance sheet changes, update this
var SEARCH_COLUMN_INDEX = 3;
@peterkappus
peterkappus / backup.rb
Created July 10, 2016 22:00
A backup script to backup various things to my USB Drive
#!/usr/bin/ruby
#copy ~/Library/keychain
#for testing
rsync_flags = "avzn --delete"
#for real...
#--delete => delete files which don't exist in the source
rsync_flags = "avz --delete"
@peterkappus
peterkappus / iterm_profile.json
Last active December 31, 2016 15:31
Setting up my Macbook Air
{
"Guid" : "535EDCAD-1190-4EA2-840A-B79A37561292",
"Tags" : [
],
"Ansi 12 Color" : {
"Blue Component" : "0.8117647",
"Green Component" : "0.6235294",
"Red Component" : "0.4470588"
},
@peterkappus
peterkappus / Google Spreadsheet Cheats.md
Created July 8, 2016 13:33
Some handy tidbits for working with Google Spreadsheets

Select rows within a date range using an import range statement.

=query(importrange("https://docs.google.com/spreadsheets/d/<PEOPLE_DATABASE>/edit#gid=1208515556","CS People Database!A:Z"),"SELECT * WHERE Col6 = TRUE AND Col14 > date '" & text(E1,"yyyy-MM-dd") &"' AND Col14 < date '" & text(G1,"yyyy-MM-dd") &"' Order by Col14")
@peterkappus
peterkappus / weekdone-sinatra.rb
Created June 21, 2016 21:39
A demo WeekDone omniauth strategy and REST client in a sinatra app.
require 'sinatra'
#require 'pry'
require 'omniauth-oauth2'
require 'omniauth'
module OmniAuth
module Strategies
class WeekDone < OmniAuth::Strategies::OAuth2