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
@BinaryMuse
BinaryMuse / pre-commit
Created February 27, 2010 09:23
git pre-commit hook, I use it to detect trailing spaces
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by git-commit with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, make this file executable.
# This is slightly modified from Andrew Morton's Perfect Patch.
@BinaryMuse
BinaryMuse / EmbeddedGwt.java
Created March 28, 2010 07:11
DND - Serving GWT app with embedded Java - used on blog
package net.binarymuse.EmbeddedGwt;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.eclipse.jetty.webapp.WebAppContext;
public class EmbeddedGwt {
public static void main(String[] args) throws Throwable {
HTML Template:
{foreach releases as release}
<h1><a href="{release.link}">{release.title}</a></h1>
<p>{release.teaser}</p>
{/foreach}
<p><small>If you believe this has been sent to you in error, please safely <a href="{optout_confirm_uri}">unsubscribe</a>.</small></p>
Feed URL:
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/ (\1$(parse_git_stash))/"
}
parse_git_stash() {
git stash list 2> /dev/null | wc -l | sed -e "s/ *\([0-9]*\)/\ \+\1/g" | sed -e "s/ \+0//"
}
parse_svn_branch() {
parse_svn_url | sed -e 's#^'"$(parse_svn_repository_root)"'##g' | awk -F / '{print " ("$1 "/" $2 ")"}'
}
parse_svn_url() {
@BinaryMuse
BinaryMuse / README.md
Created July 9, 2010 16:42
GWT-Wizard Sample Code

Sample code from a page of the Fresno Pacific University Vehicle Reservation Wizard.

RequesterInfoPage.java defines the business logic for the page, as well as the Display interface for the UI; RequesterInfoPageView.java implements the Display interface. Notice that the view extends LazyComposite to lazily create the view on demand (the first time the page is shown).

#!/bin/bash
# fpu-mount
# parameter one should be the share
# paramater two should be the mountpoint
# the mountpoint will be created if it doesn't exist
SHARE=$1
MOUNTPOINT=$2
@BinaryMuse
BinaryMuse / ContextRemoteServiceServlet.java
Created July 14, 2010 22:09
policy file fix for GWT app behind reverse proxy
import java.io.IOException;
import java.io.InputStream;
import java.text.ParseException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.google.gwt.user.server.rpc.SerializationPolicy;
import com.google.gwt.user.server.rpc.SerializationPolicyLoader;
@BinaryMuse
BinaryMuse / Curl.php
Created August 2, 2010 17:00
PHP cURL wrapper
<?php
/**
* Wrapper class that creates Curl_Workers to do
* the heavy lifting for cURL requests.
*/
class Curl {
/**
* Creates and returns a new Curl_Worker
@BinaryMuse
BinaryMuse / rvm.sh
Created August 8, 2010 02:40
DND (blog): install RVM, Ruby 1.9.2 RC and Rails 3 RC.sh
#!/bin/bash
# Install RVM
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
# Modify ~/.bash_profile as necessary and source it to bring in changes
echo "[[ -s \"\$HOME/.rvm/scripts/rvm\" ]] && source \"\$HOME/.rvm/scripts/rvm\"" >> ~/.bash_profile
source ~/.bash_profile
# Install and use Ruby 1.9.2
rvm install ruby-1.9.2-rc2 && rvm use 1.9.2
# Create a gemset for and install Rails 3 RC
rvm gemset create rails3rc && rvm use 1.9.2@rails3rc
~/src/youtube/vids