Skip to content

Instantly share code, notes, and snippets.

View chris-roerig's full-sized avatar
😎
💯

Chris Roerig chris-roerig

😎
💯
View GitHub Profile
@chris-roerig
chris-roerig / gist:79777c111374f6356348
Last active October 19, 2020 23:17
How to install NameCheap EssentialSSL wildcard certificate in nginx on Ubuntu 14.04

First generate a new CSR openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr

DO NOT DELETE THE server.key FILE

Follow the rest of this guide after activating the csr and recieving the certs from Namechep.

unzip the package from COMODO

unzip STAR_<yourfqdn_here>_com.zip                                                                               
@chris-roerig
chris-roerig / gist:20237fbce75a58ec6fc4
Last active August 29, 2015 14:10
Iterates a list of URLs from a CSV, tries to access each page and adds it to a CSV based on the status code.
require 'curb'
require 'csv'
file = 'crawlreport.csv'
started_at = Time.new
codes = {
missing: [],
success: [],
redirect: [],
failure: []
@chris-roerig
chris-roerig / gist:bb7077e2e3ff742e5cdb
Last active August 29, 2015 14:10
A simple script to swap the hosts file
#!/bin/bash
case "$1" in
live)
cp /etc/hosts.live /etc/hosts
echo "Now using the live hosts file"
exit
;;
@chris-roerig
chris-roerig / gist:b6d57be82657d17c6c67
Created March 2, 2015 17:31
A rake task for creating hamlbars templates
require 'fileutils'
namespace :hamlbars do
desc "Creates a hamlbars template in app/assets/javascripts/templates"
task :template do
template = ARGV.last
dir = template.rpartition("/").first
file = template.rpartition("/").last
begin
@chris-roerig
chris-roerig / gist:c62ad21384c56aad1ea7
Created March 4, 2015 15:44
Javascript date.toString()
//Extracted from https://code.google.com/p/datejs/source/browse/trunk/src/core.js#761
/**
* Converts the value of the current Date object to its equivalent string representation.
* Format Specifiers
<pre>
CUSTOM DATE AND TIME FORMAT STRINGS
Format Description Example
------ --------------------------------------------------------------------------- -----------------------
s The seconds of the minute between 0-59. "0" to "59"
@chris-roerig
chris-roerig / muter.rb
Created August 12, 2015 16:38
mac osx audio mute toggler
class Muter
def mute_for(minutes = 5)
return restore if minutes == 0
Thread.new do
mute
sleep (minutes * 60)
restore
end
end
###
class ExpectedDeliveryDateRow
include Helper::Date
include KioskDashboardCard::ViewHelpers
def initialize(is_deliverd, delivery_date)
@is_deliverd = is_deliverd
@delivery_date = delivery_date
end
"devDependencies": {
"broccoli-asset-rev": "^2.2.0",
"ember-cli": "1.13.13",
"ember-cli-app-version": "^1.0.0",
"ember-cli-babel": "^5.1.5",
"ember-cli-bootswatch": "1.13.0",
"ember-cli-content-security-policy": "0.4.0",
"ember-cli-dependency-checker": "^1.1.0",
"ember-cli-emblem": "0.3.1",
@chris-roerig
chris-roerig / file_utility.rb
Last active January 25, 2016 02:04
A little file path utility
# usage:
# safe_path "app/controllers"
def safe_path(path = "")
File.join(*path.split("/"))
end
@chris-roerig
chris-roerig / info.rb
Created February 8, 2016 14:46
Simple puts-er logger
# prints a message in the console.
# ##################
# this is my message
# ##################
def info(message, char = "#" )
len = `tput cols`.to_i
bar = -> { (len/ char.length).times { print char }; print "\n" }
(message.length / len).times { |n| message.insert(((n +1 ) * len), "\n") }
bar.call