Skip to content

Instantly share code, notes, and snippets.

Avatar

Jordan Dobson jordandobson

View GitHub Profile
View application_controller.rb
# Three things to add:
# * before_filter call
# * action_has_layout? method (if you have one, combine them)
# * adjust_for_inline
#
class ApplicationController < ActionController::Base
# ...
before_filter :adjust_for_inline
View iphone-tethering.mdown

HOWTO: iPhone AT&T Tethering

In 10 steps:

  • Update iTunes to 8.2 via Software Update
  • Update your iPhone to the 3.0 release (out today - June 17th)
  • Download this dmg and mount it: tethering file
  • Enable hidden carrier testing option (in Terminal.app): defaults write com.apple.iTunes carrier-testing -bool TRUE
  • Start up iTunes
@jordandobson
jordandobson / Help_Chat_bubble_with_css_and_unicode.html
Created Aug 12, 2009
A Help / Chat bubble using only CSS + Unicode. No Images needed!
View Help_Chat_bubble_with_css_and_unicode.html
<html>
<head>
<title>Help / Chat Bubble with CSS + Unicode</title>
<!--
Created by: Jordan Robert Dobson
JordanDobson@Gmail.com
http://MadeBySquad.com
http://twitter.com/JordanDobson
@jordandobson
jordandobson / form_help_bubble.html
Created Aug 12, 2009
An example of using a CSS+Unicode help bubble with an input field.
View form_help_bubble.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Help Bubble with CSS + Unicode + Input field</title>
<!--
Created by: Jordan Robert Dobson
JordanDobson@Gmail.com
View gist:205438
require 'open-uri'
module SchoolReport
NO_ALERT = "0"
ALERT = /.+\w+\s+(\d)\s+\d+/
URL = 'http://media.schoolreport.org/media/export.php?userId=422'
def self.has_alert?
open(URL) do |report|
View indicator.css
a#cartButton{
overflow: visible;
}
a#cartButton small.indicator{
font-size: 1em;
position: absolute;
display: block;
overflow: hidden;
top: -.5em;
right: 100%;
@jordandobson
jordandobson / SegmentedMenu.css
Created Jan 11, 2010
Segmented Controls Styles for JQTouch using UL > LI > A
View SegmentedMenu.css
/* @group Segmented */
ul.segmented {
border: 0px;
padding-bottom: 1px;
background: none;
overflow: hidden;
list-style: none;
text-align: center;
font-size: 1px;
View JPlayer_Radio_show_prototype.js
var trkTimeTotal = 50000; // 50 seconds in milliseconds
var trkTimeStart = 10000; // 10 seconds in milliseconds
$(document).ready(function(){
$("#jquery_jplayer").jPlayer({
ready: function () {
$(this).setFile("mp3/10SecondsIn.mp3").play();
},
volume: 100,
oggSupport: false
View iphone-ipad-detect-version.js
<script type="text/javascript">
var appVer = navigator.appVersion;
var searchVersion = /\s(\d)_\d/;
var searchDevice = /\s[(](\w+\s?\w*)[;]\s/;
var isIPhone = false;
var isIPad = false;
if (searchVersion.exec(appVer) && searchDevice.exec(appVer)){
var deviceVersion = searchVersion.exec(appVer)[1];
if ("iPhone" == searchDevice.exec(appVer)[1]){ isIPhone = deviceVersion; }
if ("iPhone Simulator" == searchDevice.exec(appVer)[1]){ isIPhone = deviceVersion; }
@jordandobson
jordandobson / test_taskmaster.rb
Created Apr 15, 2010
Example of Setup for storing puts and clearing for testing
View test_taskmaster.rb
class TestTaskmaster < Test::Unit::TestCase
def setup
###
# Setup Class
@tm = Taskmaster
###