Skip to content

Instantly share code, notes, and snippets.

View phudgins's full-sized avatar

Pete Hudgins phudgins

  • Dominion Enterprises
  • Norfolk, VA
View GitHub Profile
@ramn
ramn / XmlSchemaValidator.scala
Created December 2, 2010 11:02
XML Schema validator in Scala
import javax.xml.transform.stream.StreamSource
import javax.xml.validation.Schema
import javax.xml.validation.SchemaFactory
import javax.xml.validation.{Validator=>JValidator}
import org.xml.sax.SAXException
object Validator {
def main(args: Array[String]) {
require(args.size >= 2, "Params: xmlFile, xsdFile")
val result =
@morhekil
morhekil / LICENSE
Last active January 22, 2017 22:12
Implementation of deep symbolization of keys for Ruby hashes
The MIT License (MIT)
Copyright (c) 2015 Oleg Ivanov http://github.com/morhekil
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@PatrickTulskie
PatrickTulskie / resque_retry.rb
Created July 25, 2011 19:15 — forked from clemens/resque_retry.rb
Retry failed Resque jobs in Ruby
# inspired by http://ariejan.net/2010/08/23/resque-how-to-requeue-failed-jobs
# retry all failed Resque jobs except the ones that have already been retried
# This is, for instance, useful if you have already retried some jobs via the web interface.
Resque::Failure.count.times do |i|
Resque::Failure.requeue(i) unless Resque::Failure.all(i, 1)['retried_at'].present?
end
# retry all :)
Resque::Failure.count.times do |i|
@nz
nz / sunspot_resque.rb
Last active July 10, 2023 21:35
Sunspot with Resque
# app/models/post.rb
class Post
searchable :auto_index => false, :auto_remove => false do
text :title
text :body
end
after_commit :resque_solr_update, :if => :persisted?
@tsabat
tsabat / zsh.md
Last active July 7, 2024 16:56
Getting oh-my-zsh to work in Ubuntu
@netmute
netmute / README.md
Last active October 27, 2022 13:22
Game of Life

Game of Life

An implementation of Conway's Game of Life in 140 characters of Ruby.

Author

Created by Simon Ernst (@sier).

@metaskills
metaskills / gist:2044146
Created March 15, 2012 13:16
A Git.io URL Shortener Console Function
# If you are not on a Mac and do not want the URL
# copied to the clipboard, remove the pbcopy command.
function gitio () {
local url=$(curl -s -i http://git.io -F "url=$1" | grep "Location: " | cut -d" " -f2 | tr "" "\n")
echo "$url" | pbcopy
echo $url
}
@coreyhaines
coreyhaines / .rspec
Last active April 11, 2024 00:19
Active Record Spec Helper - Loading just active record
--colour
-I app
@bds
bds / gist:2422119
Created April 19, 2012 16:25
Push to Github, Heroku and notify NewRelic of deployment
git push origin master && git push heroku master && newrelic deployments
@nebiros
nebiros / Gemfile
Created May 23, 2012 15:58
rails + unicorn + rbenv + init.d daemon
group :production do
gem "unicorn"
end