Skip to content

Instantly share code, notes, and snippets.

View micahbrich's full-sized avatar

Micah Rich micahbrich

View GitHub Profile
# to run: docker-compose run
#
# Create a .evn file in the same folder as this file and change the variables.
# MOUNT_POINT=/tmp/
# VPN_PROVIDER=changeme
# VPN_CONFIG=changeme
# VPN_USERNAME=changeme
# VPN_PASSWORD=changeme
#
#
@micahbrich
micahbrich / next js starter code
Last active August 19, 2019 02:14
Next.js Starter Code
yarn add next react react-dom @emotion/core @emotion/styled babel-plugin-emotion @zeit/next-mdx @mdx-js/loader
@micahbrich
micahbrich / packages.json
Created July 8, 2018 10:00
atom sync-settings
//
@micahbrich
micahbrich / generate_and_deploy_assets.rb
Created November 16, 2009 15:25 — forked from aeden/generate_and_deploy_assets.rb
capistrano recipe for moving public files to s3
desc "Generate and deploy assets"
task :deploy_assets, :roles => :app do
# get the previous timestamp
old_timestamp = File.read("config/deploy_timestamp").to_i rescue 0
# generate timestamp into config/deploy_timestamp
timestamp = Time.now.to_i
File.open("config/deploy_timestamp", 'w') do |f|
f.write(timestamp)
end

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

class Pitcher
attr_accessor :whip, :age
alias :whip_1 :whip
(2..20).each do |num|
define_method("whip_#{num}") do
if self.age < 28
eval("self.whip_#{num-1}") * 0.95
else
eval("self.whip_#{num-1}") * 1.05
{% for post in paginator.posts %}
<h1><a href="{{ post.url }}">{{ post.title }}</a></h1>
<h5 class="date">{{post.date}}</h5>
<div class="content">
{{ post.content }}
</div>
{% endfor %}
@micahbrich
micahbrich / vhost
Last active November 3, 2015 19:16 — forked from asimpson/bash_function
This little script sets up a custom domain in MAMP and your hosts file.
#!/bin/bash
RED="\033[0;31m"
YELLOW="\033[33m"
REDBG="\033[0;41m"
BLACKBG="\033[0;40m"
WHITE="\033[1;37m"
NC="\033[0m"
mkdir -p /Applications/MAMP/Library/vhosts;
@micahbrich
micahbrich / gist:4127466
Created November 21, 2012 20:31
Reading Time
def reading_time(content)
wordcount = content.to_s.scan(/(\w|-)+/).length.to_f # count words
reading_time_in_s = (wordcount / 275)*60 # avg american reading time is around 250 words per minute
reading_time = Time.at(reading_time_in_s).gmtime.strftime("%-M minutes, %-S seconds") #convert to pretty string
end
@micahbrich
micahbrich / gist:1118613
Created August 1, 2011 17:44
Submission Dates markup
<strong>August 1<sup>st</sup></strong> through <strong>October 1<sup>st</sup></strong>