Skip to content

Instantly share code, notes, and snippets.

@mattpatterson94
mattpatterson94 / content_formatter_spec.rb
Last active August 29, 2015 14:23
Content Formatter spec
require 'content_formatter'
describe ContentFormatter do
describe "awesome"
it "returns awesome when AW is given" do
text = "AW"
expect(ContentFormatter.awesome(text)).to eq("Awesome")
end
@mattpatterson94
mattpatterson94 / Preferences.sublime-settings
Created July 11, 2015 06:02
Sublime Text 3 User Preferences
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"copy_with_empty_selection": false,
"font_size": 12.0,
"ignored_packages":
[
"Vintage"
],
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Example aliases
@mattpatterson94
mattpatterson94 / dockerflow.md
Created December 1, 2015 05:00
Dockerflow
@mattpatterson94
mattpatterson94 / Gemfile
Last active March 29, 2016 04:00
Simple test configuration for RSpec in Rails
group :test do
gem 'simplecov', require: false
gem 'factory_girl_rails'
gem 'faker'
gem 'pry-rails'
gem 'pry-rescue'
gem 'database_cleaner'
gem 'capybara'
gem 'capybara-screenshot'
end
@mattpatterson94
mattpatterson94 / README.md
Last active February 28, 2017 01:23
Cloning a repository by setting upstream and rebasing into master.

This is experimental. Methodology is questionable. Any feedback is welcome.

  • Take a parent repository git@github.com:Example/example.git
  • Take a child repository git@github.com:Example/child.git
cd child;
git checkout master;
git remote add upstream git@github.com:Example/example.git;
git checkout -b parent;
@mattpatterson94
mattpatterson94 / woocommerce-input-class.php
Last active September 3, 2017 10:15
Woocommerce Bulma Form inputs
<?php
function lv2_add_bootstrap_input_classes( $args, $key, $value = null ) {
/* This is not meant to be here, but it serves as a reference
of what is possible to be changed.
$defaults = array(
'type' => 'text',
'label' => '',
'description' => '',
@mattpatterson94
mattpatterson94 / certbot.md
Created February 4, 2018 23:54
Set up Certbot

SET UP CERTBOT

#dev/server #dev/scripts

This is the setup guide for Certbot on Ubuntu 16.04 NGINX

https://certbot.eff.org/#ubuntuxenial-nginx

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot

CERTBOT RENEW CERTIFICATE CRON

#dev/server #dev/snippets

touch cron_log.log
touch renew-certs
chmod 777 renew-certs

Crontab

@mattpatterson94
mattpatterson94 / nginx.conf
Last active February 4, 2018 23:56
NGINX Config with SSL Template
# NGINX CONFIG W/ SSL TEMPLATE
#dev/wordpress #dev/snippets #dev/server
```
server {
listen 80;
listen [::]:80;
server_name www.example.com;
return 301 https://$host$request_uri;
}