Skip to content

Instantly share code, notes, and snippets.

View milesmatthias's full-sized avatar

Miles Matthias milesmatthias

View GitHub Profile
@milesmatthias
milesmatthias / sd_to_gcloud.rb
Created January 4, 2020 00:20
Stackdriver UI to gcloud command
#!/usr/bin/env ruby
# HOWTO:
# 1. Copy your filters from the SD log UI
# 2. Run `pbpaste | ruby sd_to_gcloud.rb`
query=[]
ARGF.each_line do |line|
query.push line.gsub("\n", "").gsub("\"", "")
@milesmatthias
milesmatthias / Dockerfile
Last active April 1, 2019 18:26
miles dev image
FROM ubuntu:latest
RUN apt-get update && apt-get -y upgrade && apt-get install sudo
RUN useradd -ms /bin/bash mmatthias && mkdir -p /home/mmatthias/.ssh && \
echo "mmatthias ALL=(ALL) NOPASSWD:ALL" | tee -a /etc/sudoers
RUN apt-get install -y git curl netcat redis-server \
openjdk-8-jdk python python3.7 vim
@milesmatthias
milesmatthias / build_and_deploy.sh
Created October 6, 2015 21:36
Gulp Build & Netlify deploy script
#!/bin/sh
#
# Usage: ./build.sh staging|production
#
stage=$1
git_branch=`git rev-parse --abbrev-ref HEAD`
@milesmatthias
milesmatthias / directory_upload.rb
Created September 1, 2014 00:57
S3 directory upload in ruby. Switched http://avi.io/blog/2013/12/03/upload-folder-to-s3-recursively to use the official aws ruby sdk.
#!/usr/bin/env ruby
require 'rubygems'
require 'aws-sdk'
class S3FolderUpload
attr_reader :folder_path, :total_files, :s3_bucket
attr_accessor :files

Keybase proof

I hereby claim:

  • I am milesmatthias on github.
  • I am milesm (https://keybase.io/milesm) on keybase.
  • I have a public key ASBiXn_EfAqCVbq5MbTQAS-NE0allEqJs9xlVTjAK-itggo

To claim this, I am signing this object:

@milesmatthias
milesmatthias / a.md
Last active January 2, 2016 09:58 — forked from ahoward/a.md

recently our team had an exchange about lazy evaluation of ORM queries in ruby ( https://gist.github.com/ahoward/8285529 ) - this prompted me to think about how deep rails has really become and just how hard good MVC organization for the web really is. back in the day it took a special kind of developer to understand how to not kill a db when it was used in a web app - now it's pretty easy and, while this seems good on the outside, in the inside i think today's developers understand less and less about why web programming is really the hardest kind there is.

that's the motivation for today's quiz. to take it fork and keep your answer under 142 LOC total

given a model, Post, write code which will

  • load the 2nd set of 5 results (page 2 of 5 each)
  • access them in the view
@milesmatthias
milesmatthias / action.rb
Last active December 20, 2015 18:19 — forked from ahoward/action.rb
# it's not critical for understanding
# but here is the associated server-side action
#
def version
@program = load_program!
@version = @program.versions.find(params[:version_id])
if stale?(:last_modified => @version.updated_at, :etag => @version.cache_key)
render
@milesmatthias
milesmatthias / Outline of Meteor Intro Screencast.txt
Last active December 11, 2015 06:58
This is the outline / notes I took while listening to the Meteor introductory screencast. I wanted to be able to reference their main selling points later. Maybe this will save you some time too.
http://www.meteor.com/screencast
1. Download Meteor
2. Create new project
3. Create HTML file
4. Run Meteor / go to localhost in browser
5. Live Update Demo (changed HTML file)
6. Pasted in simple app (made it clear that this app uses handlebars and mongodb, but meteor lets you use whatever you want.
The app uses Templates and Collections)
@milesmatthias
milesmatthias / events.md
Last active August 29, 2015 14:20
Boulder Startup Week Development Track

Infrastructure & Architecture Design

Monday, 3:30pm - 4:30pm @ Boomtown;

With all of the powerful cloud services out there nowadays, it's more important than ever to give good thought about architecture when building your applications. This event has 3 awesome speakers who have experience in architecture design and will share their expertise and answer your questions about how to decide what infrastructure tools to use on your next project.

Dev Happy Hour

Tuesday, 4pm - 5pm @ Lyfe Kitchen

@milesmatthias
milesmatthias / remove_s3_object.rb
Created November 13, 2014 19:25
simple ruby script to remove an object from s3. requires having the aws gem installed.
#!/usr/bin/env ruby
##
# usage: AWS_SECRET_KEY=xxx AWS_ACCESS_KEY=xxx S3_BUCKET_NAME=xxx ./remove_s3_object.rb file1.html file2.html
#
#
require 'aws'
require 'pry'