Skip to content

Instantly share code, notes, and snippets.

View jensendarren's full-sized avatar

Darren Jensen jensendarren

View GitHub Profile
@jensendarren
jensendarren / update-keypair-in-ec2.md
Last active February 19, 2020 03:09
Add new SSH Keypair to an EC2 instance when you have lost your .pem file!

How to update your EC2 instance with a new keypair

  1. Create a new keypair in AWS Console

  2. Start a new temporary recovery EC2 instance

  3. Stop the lost keypair instance

  4. Detach the EBS drive from the lost keypair instance

@jensendarren
jensendarren / VueJS Rapid Prototyping Example
Created February 11, 2020 07:40
A basic VueJS Rapid Prototyping Example
<!--Make sure to install @vue/cli-service-global first-->
<!--Serve this up using `vue serve` at the command line-->
<!--Details here: https://cli.vuejs.org/guide/prototyping.html -->
<template>
<h1>Hello {{name}}</h1>
</template>
<script>
export default {
data() {

Keybase proof

I hereby claim:

  • I am jensendarren on github.
  • I am jensendarren (https://keybase.io/jensendarren) on keybase.
  • I have a public key ASCUxtscnfGIjSlMCwIboYoEa2sGTmteWlwklL9PgF72xAo

To claim this, I am signing this object:

@jensendarren
jensendarren / obervable_example.rb
Last active June 27, 2018 08:30
Example of using Observable in Ruby
require 'observer'
class CoffeeShop
include Observable
attr_reader :customers
def initialize(name, capacity)
@name = name
@capacity = capacity
@customers = []
@jensendarren
jensendarren / enumerable_example.rb
Created January 7, 2015 11:26
See rotati blog post
class Coffee
attr_accessor :name
attr_accessor :strength
def initialize(name, strength)
@name = name
@strength = strength
end
def <=>(other_coffee)
@jensendarren
jensendarren / tddium_post_build.rake
Created October 5, 2012 10:30 — forked from semipermeable/tddium_post_build.rake
Tddium post-build task to deploy into Heroku
def cmd(c)
system c
end
namespace :tddium do
desc "post_build_hook"
task :post_build_hook do
# This build hook should only run after CI builds.
#
# There are other cases where we'd want to run something after every build,
@jensendarren
jensendarren / bashrc
Created July 27, 2015 01:51
Add git alias to your terminal command set
# Add this to your ~/.bashrc file then run `source ~/.bashrc`
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias gg='git grep -i'
alias go='git checkout '
@jensendarren
jensendarren / gist:e5614e19db0dcf96fa44
Created July 9, 2015 04:16
Git diff which includes new files
if test "$#" = 0; then
(
git diff
git ls-files --others --exclude-standard |
while read -r i; do git diff -- /dev/null "$i"; done
)
else
git diff "$@"
fi
@jensendarren
jensendarren / uri_example.rb
Created January 8, 2015 12:48
An example of using URI in Ruby
require 'uri'
require 'open-uri'
google_url = "http://google.com/"
url = URI.parse(google_url)
# Get the hostname
puts "The hostname is #{url.hostname}"
@jensendarren
jensendarren / logger_example_stdout.rb
Created January 8, 2015 12:47
An example of using STDOUT Logger in Ruby
# http://www.ruby-doc.org/stdlib-2.1.0/libdoc/logger/rdoc/Logger.html
require 'logger'
class CoffeeShop
attr_reader :logger
def initialize(name)
@name = name
@menu = []
@logger = Logger.new(STDOUT)