Skip to content

Instantly share code, notes, and snippets.

View rianrainey's full-sized avatar

Rian Rainey rianrainey

View GitHub Profile
@rianrainey
rianrainey / mixin-ouput.css
Created September 23, 2013 15:54
Use Bourbon's mixin, @font-face, to easily include Fonts into your project.
/* @include font-face(SourceSansPro, '/fonts/Source_Sans_Pro/SourceSansPro-Regular'); */
@font-face {
font-family: SourceSansPro;
font-weight: normal;
font-style: normal;
src: url(/assets/Source_Sans_Pro/SourceSansPro-Regular.eot);
src: url(/assets/Source_Sans_Pro/SourceSansPro-Regular.eot?#iefix) format("embedded-opentype"),
url(/assets/Source_Sans_Pro/SourceSansPro-Regular.woff) format("woff"),
url(/assets/Source_Sans_Pro/SourceSansPro-Regular.ttf) format("truetype"),
@rianrainey
rianrainey / download_das.rb
Created April 3, 2018 19:37
Download DAS
#! /usr/bin/env ruby
require 'mechanize'
agent = Mechanize.new
agent.pluggable_parser.default = Mechanize::Download
agent.get 'https://www.destroyallsoftware.com/screencasts/catalog'
episodes = agent.page.search('.episode > a').map { |a| a['href'] }
@rianrainey
rianrainey / How to use in_array_r()
Created December 12, 2012 00:34
PHP doesn't make it very easy to recursively look inside a multi-dimensional array. These couple methods make that easier.
$simpsons = array('bart', 'lisa', 'homer');
echo in_array_r("bart", $simpsons) ? 'found' : 'not found';
require: rubocop-rspec
#inherit_from: .rubocop_todo.yml
AllCops:
Exclude:
- bin/**/*
- db/**/*
- script/**/*
- vendor/**/*
@rianrainey
rianrainey / keybase.md
Created May 4, 2016 20:55
Keybase verification

Keybase proof

I hereby claim:

  • I am rianrainey on github.
  • I am rianrainey (https://keybase.io/rianrainey) on keybase.
  • I have a public key whose fingerprint is FFE1 CB9B 7E14 89A2 B0BD 87B9 43C0 0C1B 61E1 7CCA

To claim this, I am signing this object:

@rianrainey
rianrainey / instructions.md
Last active December 30, 2015 06:29
Set up SSL from GoDaddy on Heroku

Heroku Instructions

I was assigned the task to renew the SSL for a client that already was renewed on GoDaddy.

Use openssl to generate a private key

openssl genrsa -des3 -out server.pass.key 2048

Strip of password from previous generated key

openssl rsa -in server.pass.key -out server.key

Create Certificate Signing Request (CSR)

openssl req -nodes -new -key server.key -out server.csr

module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
@rianrainey
rianrainey / .ackrc
Created September 30, 2013 15:15
Ack doesn't search through all files by default. I added some more common filetypes in my dot file.
# Ack is a command line tool that is better than Grep, betterthangrep.com
# Make sure Ack knows how to search common filetypes used in Rails projects
--type-add=css=scss
--type-add=js=hbs
--type-add=js=coffee
@rianrainey
rianrainey / external_file.js
Last active December 22, 2015 08:18
Open external links in a new window.
$("a").each(function() {
var a;
a = new RegExp("/" + window.location.host + "/");
if (!a.test(this.href)) {
return $(this).click(function(event) {
event.preventDefault();
event.stopPropagation();
return window.open(this.href, "_blank");
});
}