This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Script for printing a CSV of a conversation in a Hangout JSON file from Google Takeout. | |
# | |
# Brent Theisen | |
# | |
require 'json' | |
require 'csv' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: `basename $0` domain" | |
exit 85 | |
fi | |
DOMAIN=$1 | |
HOST_KEY="$DOMAIN".key | |
CSR="$DOMAIN".csr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ "$#" -ne 3 ]; then | |
echo "Usage: `basename $0` file filtercmd outputcmd" | |
exit 85 | |
fi | |
FILE=$1 | |
FILTERCMD=$2 | |
OUTPUTCMD=$3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Rack | |
class Request | |
def scheme | |
if @env['HTTPS'] == 'on' | |
'https' | |
elsif @env['HTTP_X_FORWARDED_SSL'] == 'on' | |
'https' | |
elsif @env['HTTP_X_FORWARDED_PROTO'] | |
@env['HTTP_X_FORWARDED_PROTO'].split(',')[0] | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# To install copy this file in to <RAILS_APP>/lib/tasks/factory_girl.rake. | |
# To use run: rake db:factory_girl_load | |
# | |
namespace :db do | |
namespace :factory_girl do | |
desc 'Load Factory Girl factories into the current environment\'s database.' | |
task :load => :environment do | |
FactoryGirl.registry.each do |(name, factory)| | |
FactoryGirl.build name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage() | |
{ | |
cat << EOF | |
usage: $0 <ip> [blocklist] | |
ip The IP to check. | |
blocklist The Spamhaus block list to check. Defaults to zen but can be one of these: zen, sbl, xbl, pbl or dbl. | |
EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Replace $.ajax on your subdomain with a copy taken | |
* from your base domain. All jQuery AJAX actions go | |
* through $.ajax (i.e. $.get, $.post), so it's all good. | |
*/ | |
(function() { | |
var iframe, | |
onload, | |
queue = [], |