Skip to content

Instantly share code, notes, and snippets.

View timnovinger's full-sized avatar

Tim Novinger timnovinger

View GitHub Profile
@timnovinger
timnovinger / US States Select Options.txt
Created September 14, 2009 16:17
US States Select Options
<selectname="state">
<option>Alabama</option>
<option>Alaska</option>
<option>Arizona</option>
<option>Arkansas</option>
<option>California</option>
<option>Colorado</option>
<option>Connecticut</option>
<option>Delaware</option>
<option>Florida</option>
@timnovinger
timnovinger / list of sup commands
Created October 7, 2009 13:51
SUP Command List
Help for inbox-mode
===================
Keybindings from inbox-mode
---------------------------
a : Archive thread (remove from inbox)
A : Archive thread (remove from inbox) and mark read
Keybindings from thread-index-mode
@timnovinger
timnovinger / my .bashrc
Created October 7, 2009 16:14
My .bashrc file
################
# SYSTEM PATHS #
################
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
################
# COLOR CODING #
################
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
@timnovinger
timnovinger / bodyid.rb
Created October 14, 2009 13:37
Automatic Body ID in Rails
###############################################
# place in /app/helpers/application_helper.rb #
###############################################
def bodytag_id
a = controller.class.to_s.underscore.gsub(/_controller$/, '')
b = controller.action_name.underscore
"#{a}-#{b}".gsub(/_/, '-')
end
@timnovinger
timnovinger / file.html
Created November 17, 2009 17:13 — forked from anonymous/file.html
Code Snippets from Mobile Webkit Development Talk on 11/16
<!-- ============================================================== -->
<!-- = Code Snippets from Mobile Webkit Development Talk on 11/16 = -->
<!-- ============================================================== -->
<!-- =========================== -->
<!-- = Conditional Stylesheets = -->
<!-- =========================== -->
<link media="only screen and (max-device-width: 480px)" href="small-device.css" type= "text/css" rel="stylesheet">
httpauth = Twitter::HTTPAuth.new( current_account.twitter_username, current_account.twitter_password )
client = Twitter::Base.new(httpauth)
# TO DO -- Yep, should filter the request to only get tweets since the last check
client.friends_timeline.each do |tweet|
# TO DO -- Yep, need to check to see if the tweet is already in there
status = Status.create(
:status_created_at => tweet.status_created_at,
:status_id => tweet.id,
:message => tweet.text,
:source => tweet.source,
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
[PHP]
;;;;;;;;;;;
; WARNING ;
;;;;;;;;;;;
; This is the default settings file for new PHP installations.
; By default, PHP installs itself with a configuration suitable for
; development purposes, and *NOT* for production purposes.
; For several security-oriented considerations that should be taken
; before going online with your site, please consult php.ini-recommended
# TRUNCATE BY WORD COUNT
def snippet (text, wordcount, separator="...")
text.split[0..(wordcount-1)].join(" ") + (text.split.size > wordcount ? separator : "")
end
## EXAMPLE USAGE
---
:update_sources: true
:bulk_threshold: 1000
:verbose: true
:backtrace: false
:benchmark: false
gem: --no-ri --no-rdoc
:sources:
- http://gems.rubyforge.org/
- http://gemcutter.org