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
<?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 / gist:3b0a4ba166ac81840cab
Created November 3, 2014 16:20
Async fetches initiated by the store when necessary
// Component
var AnswerDisplay = React.createClass({
mixins: [FluxMixin, StoreWatchMixin("answer")],
getStateFromFlux() {
var flux = this.getFlux(),
answerStore = flux.store("answer");
return {
@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
@BinaryMuse
BinaryMuse / .gems
Created October 29, 2010 22:17
xkcd2.heroku.com : Sinatra app to display xkcd comics so that the alt text can be seen
sinatra
haml
#!/usr/bin/env ruby
require 'pp'
REGEX = /(\d+)\s+(10\/[A-Z]{1}SP-\S+).*\s+([A-Z0-9]+)/i
YEAR = "2010"
TERM = "Spring"
teachers = {}
courses = []
@BinaryMuse
BinaryMuse / moodle.js
Created November 19, 2010 22:47
FireSheep handler for Moodle
register({
name: 'moodle.domain.com',
url: 'http://moodle.domain.com/',
icon: 'http://moodle.domain.com/theme/mytheme/favicon.ico',
domains: [ 'moodle.domain.com' ],
sessionCookieNames: [ 'MoodleSession', 'MoodleSessionTest' ],
identifyUser: function() {
var site = this.httpGet('http://moodle.domain.com/user/view.php');
this.userName = site.body.querySelector('div.logininfo a').text;
# To just pull changes from Github, forcing Git to use your local changes for any conflicts:
git pull --strategy=ours origin master
# To completely update each of your Git repositories in one command (run this inside each repository):
git add . && git commit -m "Updating to current working version" && git pull --strategy=ours origin master && git push origin master