Skip to content

Instantly share code, notes, and snippets.

@rianrainey
rianrainey / mixin-ouput.css
Created Sep 23, 2013
Use Bourbon's mixin, @font-face, to easily include Fonts into your project.
View mixin-ouput.css
/* @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"),
View download_das.rb
#! /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 Dec 12, 2012
PHP doesn't make it very easy to recursively look inside a multi-dimensional array. These couple methods make that easier.
View How to use in_array_r()
$simpsons = array('bart', 'lisa', 'homer');
echo in_array_r("bart", $simpsons) ? 'found' : 'not found';
View .rubocop.yml
require: rubocop-rspec
#inherit_from: .rubocop_todo.yml
AllCops:
Exclude:
- bin/**/*
- db/**/*
- script/**/*
- vendor/**/*
@rianrainey
rianrainey / keybase.md
Created May 4, 2016
Keybase verification
View keybase.md

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 Dec 30, 2015
Set up SSL from GoDaddy on Heroku
View instructions.md

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

View Gruntfile.js
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 Sep 30, 2013
Ack doesn't search through all files by default. I added some more common filetypes in my dot file.
View .ackrc
# 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 Dec 22, 2015
Open external links in a new window.
View external_file.js
$("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");
});
}
@rianrainey
rianrainey / unix.t
Created Aug 5, 2013
Replace all PHP files will new text
View unix.t
find . -name '*.php' -exec sed -i "" 's/Old_Text/New_Text/g' "{}" \;