Skip to content

Instantly share code, notes, and snippets.

View BinaryMuse's full-sized avatar
🏳️‍🌈
Just gayin' up the place the best I can

Michelle Tilley BinaryMuse

🏳️‍🌈
Just gayin' up the place the best I can
View GitHub Profile
require 'coderay'
codeToHighlight = `pbpaste`
highlightedCode = CodeRay.scan(codeToHighlight, :ruby).div
IO.popen("pbcopy", mode='w') do |io|
io.write highlightedCode
end
<html>
<head>
<title>Test Page</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
</head>
<body>
<p>Pretend the domain is http://binarymuse.net/.</p>
<p><a href="http://google.com/">Go to Google</a></p>
package edu.fresno.gwt.vehiclereservation.shared;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* <dl>
* <dt><b>Title: </b><dd>SimpleDateFormat</dd>
@BinaryMuse
BinaryMuse / one_million_records.rb
Created September 14, 2010 03:14
Quick and ugly script to generate 1,000,000 fake accounts in MongoDB
#!/usr/bin/env ruby
require 'mongo'
require 'faker'
require 'pp'
require 'benchmark'
include Mongo
class Exception
(do not use) 09/GFA-MBA-710-OLA1
-MTH-726-FRC1
2010 Stacy Hammons Dev
ADM-742-Construction
AIMS Circles
App Tools
Art & Lit ECE
ART 300 D
BIB 720 Church and God's Mission - Geddert
BIB 752 Biblical Theology II - Geddert
<?php
/* FPU EDIT (bkt) 1/2010
* These functions are used for course sorting and for course grouping.
* Used in the function below (print_my_courses()).
*/
/**
* This function is used to sort an array of course objects
* by chronological order based on the FPU naming scheme.
package edu.fresno.samples.gwt.informerrmi.server;
import java.util.List;
import com.entrinsik.informer.core.client.data.LoadOptions;
import com.entrinsik.informer.core.client.data.Page;
import com.entrinsik.informer.core.domain.DataGroup;
import com.entrinsik.informer.core.domain.Order;
import com.entrinsik.informer.core.domain.report.Report;
import com.entrinsik.informer.core.domain.report.ReportExecutionRequest;
@BinaryMuse
BinaryMuse / errors.rb
Created October 3, 2010 04:08
lib/core_ext/rails/active_model/errors.rb - get one validation error message per invalid attribute
module ActiveModel
class Errors
def full_message_per_field
messages_per_field = []
handled_attributes = []
each do |attribute, messages|
next if handled_attributes.include? attribute
messages = Array.wrap(messages)
next if messages.empty?
@BinaryMuse
BinaryMuse / longest_palindrome.rb
Created October 15, 2010 21:44
O(n^3) Solution for Programming Praxis 2010-10-15: Find The Longest Palindrome In A String
#!/usr/bin/env ruby
## Find The Longest Palindrome In A String
## October 15, 2010
##
## http://programmingpraxis.com/2010/10/15/find-the-longest-palindrome-in-a-string/
##
## Greplin issued a programming challenge recently that required programmers
## to solve three problems; when completed, Greplin issued an invitation to
## send them a resume. The first problem required the programmer to find the
@BinaryMuse
BinaryMuse / longest_palindrome.rb
Created October 15, 2010 22:58
O(n^2) Solution for Programming Praxis 2010-10-15: Find The Longest Palindrome In A String edit
#!/usr/bin/env ruby
## Find The Longest Palindrome In A String
## October 15, 2010
##
## http://programmingpraxis.com/2010/10/15/find-the-longest-palindrome-in-a-string/
##
## Greplin issued a programming challenge recently that required programmers
## to solve three problems; when completed, Greplin issued an invitation to
## send them a resume. The first problem required the programmer to find the