Skip to content

Instantly share code, notes, and snippets.

View jerodsanto's full-sized avatar
:shipit:
Always be shipping

Jerod Santo jerodsanto

:shipit:
Always be shipping
View GitHub Profile
@ericrowan
ericrowan / show.html.eex
Last active May 2, 2019 14:45
changelog.com/posts - new layout options
<!-- Image w/caption, full-width -->
<figure class="richtext-figure richtext-figure--full">
<img src="https://via.placeholder.com/1200x600.png" alt="[image alt]">
<figcaption>This independent workforce survey reveals new insights into freelancing in America. Key findings: Freelancers earned an estimated $1 trillion this year, are highly motivated, growing.</figcaption>
</figure>
<!-- Image w/caption, pull left -->
<figure class="richtext-figure richtext-figure--left">
<img src="https://via.placeholder.com/1200x600.png" alt="[image alt]">
<figcaption>This independent workforce survey reveals new insights into freelancing in America. Key findings: Freelancers earned an estimated $1 trillion this year, are highly motivated, growing.</figcaption>
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

NameVirtualHost 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
ServerName pow
ServerAlias *.dev
ServerAlias *.xip.io
ProxyPass / http://localhost:20559/
ProxyPassReverse / http://localhost:20559/
ProxyPreserveHost On
@rafaelss
rafaelss / gist:3700977
Created September 11, 2012 19:04
PostgreSQL 9.2 upgrade steps
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. pg_ctl -D /usr/local/var/postgres stop -s -m fast
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. curl https://raw.github.com/fragility/homebrew/737af01178590950749cf5e841f2d086c57c5a80/Library/Formula/postgresql.rb > /usr/local/Library/Formula/postgresql.rb
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@drnic
drnic / Guardfile
Created April 5, 2012 06:45
An example Guardfile with the works for a Rails app
guard 'rspec', :version => 2 do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
# Rails example
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@coreyhaines
coreyhaines / .rspec
Last active April 11, 2024 00:19
Active Record Spec Helper - Loading just active record
--colour
-I app
@seanlilmateus
seanlilmateus / gist:1536136
Created December 29, 2011 20:51
macruby core animation Fireworks, have a nice macruby new year
#!/usr/local/bin/macruby
framework 'Cocoa'
framework 'QuartzCore'
framework 'CoreGraphics' # Mountain Lion Update
class FireworkDelegate
attr_accessor :window
def initWithURL(url)
case url