Skip to content

Instantly share code, notes, and snippets.

View jhsu's full-sized avatar
💀
compliant with future standards

Joe Hsu jhsu

💀
compliant with future standards
  • MineHub
  • New York, NY
  • X @jhsu
View GitHub Profile
@jhsu
jhsu / helpers.rb
Created November 19, 2009 13:29
dynamically define easy partial helper methods
helpers do
def method_missing(method_name, *args, &block)
method_str = method_name.to_s
if method_str =~ /^_.+$/
options = {}
options.merge!(args.first) unless args.empty?
class_eval <<-RUBY
def #{method_name.to_s}(options={})
haml :#{method_name}, :locals => args, :layout => false
@jhsu
jhsu / fnotify.pl
Created November 22, 2009 16:56
prowl notify x irssi
# todo: grap topic changes
use strict;
use vars qw($VERSION %IRSSI);
use Irssi;
$VERSION = '0.0.3';
%IRSSI = (
authors => 'Thorsten Leemhuis',
contact => '[email protected]',
@jhsu
jhsu / .bashrc
Created November 23, 2009 18:48
auto reattach screen
function _resumescreen()
{
test ${TERM/\.*/} = "screen" && return 1 #do nothing if inside screen.
test ${TERM/\.*/} = "dumb" && return 1 #do nothing if inside screen.
test ${TERM/\.*/} = "su" && return 1 #do nothing if inside screen.
screen -q -ls #check if we have any screen sessions running
test $? -ge 10 && screen -xR #and auto login if we do.
}
_resumescreen
startup_message off
shell -${SHELL}
term screen-256color
# terminfo and termcap for nice 256 color terminal
# allow bold colors - necessary for some reason
attrcolor b ".I"
# tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# erase background with current bg color
diff --git a/app/models/rubygem.rb b/app/models/rubygem.rb
index 95feba0..d097715 100644
--- a/app/models/rubygem.rb
+++ b/app/models/rubygem.rb
@@ -77,13 +77,14 @@ class Rubygem < ActiveRecord::Base
def payload(version = versions.latest, host_with_port = HOST)
{
- :name => name,
- :downloads => downloads,
diff --git a/app/models/rubygem.rb b/app/models/rubygem.rb
index 95feba0..f865f41 100644
--- a/app/models/rubygem.rb
+++ b/app/models/rubygem.rb
@@ -77,13 +77,14 @@ class Rubygem < ActiveRecord::Base
def payload(version = versions.latest, host_with_port = HOST)
{
- :name => name,
- :downloads => downloads,
From 88db6d4483a33cc67d0f23f0383c7431a1a3b254 Mon Sep 17 00:00:00 2001
From: Joseph Hsu <[email protected]>
Date: Wed, 6 Jan 2010 11:14:47 -0500
Subject: [PATCH] add version_downloads to api
---
app/models/rubygem.rb | 15 ++++++++-------
app/views/pages/api_docs.html.erb | 1 +
test/unit/rubygem_test.rb | 1 +
3 files changed, 10 insertions(+), 7 deletions(-)
alias gl='git log --graph --pretty=format:"%Cred%h%Creset . %an: %s %Cgreen(%cr)%Creset" --abbrev-commit --date=relative'
@jhsu
jhsu / .vimrc
Created January 13, 2010 01:39
set t_Co=256
colorscheme xoria256
set nocompatible " We're running Vim, not Vi!
syntax on " Enable syntax highlighting
filetype plugin indent on " Enable filetype-specific indenting and plugins
runtime! autoload/pathogen.vim
if exists('g:loaded_pathogen')
call pathogen#runtime_prepend_subdirectories(expand('~/.vimbundles'))

OCA Accepting Applications for Summer Internship Program

FOR IMMEDIATE RELEASE

11 January 2010

CONTACT

Iimay Ho | Program Manager