Public Gists by Oshuma

gist: 240279 mongo_mapper + database.yml
Gravatar
Sat Nov 21 13:30:03 -0800 2009
1
2
3
development: &global_settings
  database: textual_development
  host: 127.0.0.1
gist: 239657 mongo_auth
Gravatar
Fri Nov 20 09:47:14 -0800 2009
1
2
3
# include this in application controller
module Authentication
  protected
Gravatar
Tue Nov 03 21:44:56 -0800 2009
1
2
3
class App < Sinatra::Base
  def initialize(url = '/some/url')
    @url = url
gist: 224873 specs.watchr.rb
Gravatar
Mon Nov 02 23:44:00 -0800 2009
1
2
3
# Run me with:
#
# $ watchr specs.watchr.rb
Gravatar
Sun Oct 25 20:18:36 -0700 2009
1
2
3
  {
    :Base => 'app_config/base',
    :Error => 'app_config/error',
Gravatar
Mon Oct 19 06:24:17 -0700 2009
1
2
3
$ macgem list
 
*** LOCAL GEMS ***
Gravatar
Fri Oct 16 10:24:52 -0700 2009
1
2
3
$ ./script/console
Loading development environment (Rails 2.1.1)
>> Rails.env
gist: 207320 mac.zsh
Gravatar
Sat Oct 10 18:58:42 -0700 2009
1
2
3
# ----------------------
# variables
# ----------------------
gist: 207311 rvm-prompt.zsh
Gravatar
Sat Oct 10 18:31:43 -0700 2009
1
2
3
# zsh functions to grab the current ruby version info from RVM.
# Useful mainly in prompts (see http://skitch.com/oshuma/nni3k/zsh-prompt-git-clean).
 
gist: 204774 oshuma.zsh-theme
Gravatar
Wed Oct 07 22:22:50 -0700 2009
1
2
3
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[blue]%}(%{$fg[yellow]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[red]%}✗✗✗%{$reset_color%}"
gist: 201067 rails.watchr.rb
Gravatar
Sat Oct 03 19:31:47 -0700 2009
1
2
3
def run_tests(test_type)
  case test_type
  when :all
Gravatar
Sun Aug 16 21:08:20 -0700 2009
1
2
3
// Add the typical onclick jazz for selected links.
// (Insert your framework of choice.)
$('#tabs a').each(function(index, tab) {
gist: 139219 Simple ass jQuery accordion...
Gravatar
Wed Jul 01 18:49:37 -0700 2009
1
2
3
<!-- Add a class to the link and info elements. -->
<li>
  <a class="show-info" href="#">Show The Element</a>
Gravatar
Fri Jun 05 14:31:17 -0700 2009
1
2
3
<?php
 
// Rounds the given timestamp (string) up 15 minutes.
Gravatar
Thu Jun 04 17:15:59 -0700 2009
1
2
3
<?php
 
// CakePHP does stupid shit often times.
gist: 118931 value_or_default()
Gravatar
Wed May 27 14:48:59 -0700 2009
1
2
3
<?php
 
// Reason #5,671 PHP sucks balls: Can't set default array values
Gravatar
Thu May 21 08:52:51 -0700 2009
1
2
3
#!/usr/bin/env python
 
import os
gist: 107852 Simple jQuery effect toggles.
Gravatar
Wed May 06 17:54:58 -0700 2009
1
2
3
// Simple jQuery effect toggles.
// Use just like the jQuery.toggle() method.
//
Gravatar
Wed Apr 15 09:28:14 -0700 2009
1
2
3
<?php
class SearchController extends AppController
{
gist: 77873 ruby_proj.rb
Gravatar
Wed Mar 11 19:29:46 -0700 2009
1
2
3
class RubyProj
  def self.create(name)
    %x| mkdir #{name} |