Skip to content

Instantly share code, notes, and snippets.

@uxp
uxp / minitest-assert_equal.rb
Created June 28, 2013 17:41
Syntax errors when using assert_equal with the suggested syntax in minitest v4.3.3
require 'minitest/autorun'
class HashEquality
attr_reader :options
def initialize(opts={})
@options = opts
end
#!/usr/bin/env ruby
#
require 'optparse'
require 'minitest/autorun'
class Chatty
attr_reader :args
#!/usr/bin/env python
import random
for i in range(0, 100):
if not i % 15:
random.seed(1178741599)
print [i+1, "Fizz", "Buzz", "FizzBuzz"][random.randint(0,3)]
@uxp
uxp / gist:4689141
Last active December 12, 2015 01:09
Mac OS X Mountain Lion Server.app (v2.2 - 166) Rails Vulnerability Patch - Cumulative
diff -ru a/Server.app/Contents/ServerRoot/usr/share/collabd/gems/vendor/bundle/ruby/1.8/gems/actionpack-3.0.10/lib/action_dispatch/http/request.rb b/Server.app/Contents/ServerRoot/usr/share/collabd/gems/vendor/bundle/ruby/1.8/gems/actionpack-3.0.10/lib/action_dispatch/http/request.rb
--- a/Server.app/Contents/ServerRoot/usr/share/collabd/gems/vendor/bundle/ruby/1.8/gems/actionpack-3.0.10/lib/action_dispatch/http/request.rb 2013-01-26 14:46:11.000000000 -0700
+++ b/Server.app/Contents/ServerRoot/usr/share/collabd/gems/vendor/bundle/ruby/1.8/gems/actionpack-3.0.10/lib/action_dispatch/http/request.rb 2013-01-31 20:48:46.000000000 -0700
@@ -257,5 +257,30 @@
def local?
LOCALHOST.any? { |local_ip| local_ip === remote_addr && local_ip === remote_ip }
end
+
+ # Remove nils from the params hash
+ def deep_munge(hash)
@uxp
uxp / hamlhtml5boilerplate.html.haml
Created February 3, 2012 02:59 — forked from neiled/hamlhtml5boilerplate.html.haml
My haml version of the html 5 boiler plate code
!!! 5
/[if lt IE 7] <html lang="en" class="no-js ie6">
/[if IE 7 ] <html lang="en" class="no-js ie7">
/[if IE 8 ] <html lang="en" class="no-js ie8">
/[if IE 9 ] <html lang="en" class="no-js ie9">
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
%head
%meta{:charset => "utf-8"}/
/
Always force latest IE rendering engine (even in intranet) &amp; Chrome Frame
<?php
class MySQLDumper {
/**
*
*/
private $_dbuser;
/**
#!/bin/sh
/usr/bin/osascript -e "tell application \"Chromium\" to open location \"$1\" activate"
Jan 23 19:43:04 bahamut sshd[50155]: error: connect_to rzqeizqvmu: unknown host (hostname nor servname provided, or not known)
Jan 23 19:43:04 bahamut sshd[50155]: error: connect_to vunnmcfkwe: unknown host (hostname nor servname provided, or not known)
Jan 23 19:43:04 bahamut sshd[50155]: error: connect_to gobscdeiar: unknown host (hostname nor servname provided, or not
gilgamesh:~ uxp$ curl -D - http://mail.dixonslc.com
HTTP/1.0 404 Not Found
Server: uhttpd/1.0.0
Date: Thu, 03 Jun 2010 01:09:31 GMT
Content-Type: text/html; charset="UTF-8"
Connection: close
<HTML><HEAD><TITLE>404 Not Found</TITLE><LINK rel= stylesheet href= /form.css><META http-equiv=content-type content='text/html; charset=UTF-8'><STYLE type=text/javascript>classes.num.all.fontFamily = Courier; classes.num.all.fontSize = 10pt;</STYLE></HEAD>
<BODY><H1>404 NOT Found</H1>
File not found