Skip to content

Instantly share code, notes, and snippets.

@bryanjswift
bryanjswift / ec2-dns.rb
Created December 2, 2010 04:55
Print out useful information about running ec2 instances
#!/usr/bin/env ruby
#
# This ruby script will print out useful information about running ec2
# instances
#
# Reads AWS access and secret keys from environment variables
#
# Requires the amazon-ec2 gem (gem install amazon-ec2)
#
# Author: Bryan J Swift (bryan.j.swift@gmail.com)
<!-- Custom CSS/JavaScript -->
<script type="text/javascript" src="<?= PERCH_LOGINPATH ?>/plugins/ui/usability.js"></script>
var Card = new Class({
Implements: [Options, Events],
options: {
index: 0,
bg: null
},
initialize: function(el, options){
package com.bryanjswift.android.view;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.EditText;
import android.widget.ScrollView;
/**
/***************************************************************************
Author : Joey Mazzarelli
Email : mazzarelli@gmail.com
Homepage : http://joey.mazzarelli.com/js-opts
Source : http://bitbucket.org/mazzarell/js-opts/
License : Simplified BSD License
Version : 1.0
Copyright 2010 Joey Mazzarelli. All rights reserved.
@bryanjswift
bryanjswift / UAgentInfo.java
Created March 1, 2010 09:43
User Agent detection in Java
/* *******************************************
// LICENSE INFORMATION
// The code, "Detecting Smartphones Using PHP"
// by Anthony Hand, is licensed under a Creative Commons
// Attribution 3.0 United States License.
//
// Updated 01 March 2010 by Bryan J Swift
// - Remove un-needed if statements instead just returning the boolean
// inside the if clause
//
trait User extends Credentials {
def credentials:WkCredentials
val uuid:Option[String]
val username:String = credentials.username
val password:String = credentials.password
val role:UserRole = credentials.role
val title:String = credentials.title
val active:Boolean = credentials.active
}
case class Credentials(
import sbt._
class SbtPluginProject(info:ProjectInfo) extends PluginProject(info) {
// *-- Copy of ResolverPlugin contents because a project can't depend on itself
val resolverPath = propertyOptional[String](".resolver")
private def sbtPublishResolver = {
import java.io.FileInputStream
import java.util.Properties
val props = new Properties() { def apply(key:String) = this.getProperty(key) }
props.load(new FileInputStream(resolverPath.value))
" Vim syntax file
" Language: Velocity Template Language
" Maintainer: Antonio Terceiro <terceiro@im.ufba.br>
" Maintainer: Bryan J Swift <bryan@bryanjswift.com>
" Last Change: 2009 Sep 20
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear