Skip to content

Instantly share code, notes, and snippets.

View rob-mcgrail's full-sized avatar
🐟
codin

Rob McGrail rob-mcgrail

🐟
codin
  • Haunt
  • New Zealand
  • 19:38 (UTC +13:00)
View GitHub Profile
@rob-mcgrail
rob-mcgrail / airbrake.rb
Last active January 14, 2016 02:02
Airbrake config
# https://github.com/airbrake/airbrake-ruby#configuration
Airbrake.configure do |c|
# You must set both project_id & project_key. To find your project_id and
# project_key navigate to your project's General Settings and copy the values
# from the right sidebar.
# https://github.com/airbrake/airbrake-ruby#project_id--project_key
c.project_id = 'xxxx'
c.project_key = 'xxxxxxxxxxx'
c.root_directory = Rails.root
c.logger = Rails.logger
@rob-mcgrail
rob-mcgrail / index.php
Last active August 29, 2015 14:13
/var/www/index.php apache welcomepage with linked /etc/hosts
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap -->
<link href="//maxcdn.bootstrapcdn.com/bootswatch/3.3.1/flatly/bootstrap.min.css" rel="stylesheet">
</head>
@rob-mcgrail
rob-mcgrail / reject.rb
Created October 13, 2013 21:36
Dumping a useful but ugly script for wrangling misbehaving MMS records.
require 'ostruct'
require 'rubygems'
require 'rest_client'
require 'nokogiri'
SOLR_ROOT = 'http://search.tki.org.nz:8983'
FEDORA_ROOT = 'username:password@fedora-mms:8080/fedora'
@xpaths = {
@rob-mcgrail
rob-mcgrail / complete-build.rb
Created October 13, 2013 21:32
eZPublish svn -> git conversion
# $ ruby complete-build.rb ezp-manifest.txt ext-manifest.txt tki-pb4l 4.4-1.0.2
require 'fileutils'
EXT_REPO_DIR = 'extension-repos'
EZP_REPO_DIR = 'ezpublish'
SVN2GIT = 'svn2git'
SVN2GIT_FLAGS="--exclude doc --exclude '.*~$' -v"
@rob-mcgrail
rob-mcgrail / gist:6456340
Created September 5, 2013 21:20
CWA eventum issues => github issues
require 'rubygems'
require 'httparty'
require 'json'
require 'csv-mapper'
require 'trollop'
$opts = Trollop::options do
opt :username, "Github username", :default => 'USERNAME'
opt :password, "Github password", :default => 'XXXXXXX'
require 'rubygems'
require 'anemone'
require 'redis'
require 'trollop'
require 'highline'
$term = HighLine.new
opts = Trollop::options do
opt :redis, "Select redis store", :default => 2
@rob-mcgrail
rob-mcgrail / markdown.rb
Created September 3, 2012 03:47
Tiny markdown document server
# $ gem install sinatra bluecloth
require 'rubygems'
require 'bluecloth'
require 'sinatra'
get '/' do
f = File.open(ARGV[0])
BlueCloth.new(f.read).to_html
end
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# Dropbox Helper
alias dropb='sudo sysctl fs.inotify.max_user_watches=100000'
# Ports
alias ports='sudo netstat -lpn'
@rob-mcgrail
rob-mcgrail / search_and_delete.rb
Created July 29, 2012 22:30
Search + delete for Solr
require 'rubygems'
require 'rest_client'
require 'nokogiri'
ROOT = 'http:/SOLRHOST:8983'
# Colorful strings
@rob-mcgrail
rob-mcgrail / site.install
Created July 25, 2012 00:14
Hardcoding taxonomy terms sensibly in D7 module code.
<?php
/**
* @file
* Install, update and uninstall functions for the site feature.
*/
/**
* Implements hook_enable().
*