Public Gists by neerajdotname

Gravatar
Thu Oct 29 06:36:27 -0700 2009
1
2
3
class Person
  attr_reader :name,:age
  protected :age
Gravatar
Thu Oct 15 07:47:44 -0700 2009
1
2
3
// using jQuery make a particular drop down value as selected after the drop down has already been created
 
// <select id='alert_query_col1' data_selected='Organization'>
Gravatar
Fri Oct 09 11:48:32 -0700 2009
1
2
3
# foo.rb
puts File.dirname(__FILE__) #=> .
puts File.dirname('__FILE__') #=> .
Gravatar
Thu Oct 08 06:29:46 -0700 2009
1
2
3
#>> Indentation should be two spaces.
 
#>> Have a space before and after = or == and such operations.
Gravatar
Thu Oct 01 08:00:54 -0700 2009
1
2
3
# Have a space before and after ==
if @account.credentials.size()==1
if @account.credentials.size == 1
gist: 191094 Object-oriented JavaScript ...
Gravatar
Tue Sep 22 07:06:12 -0700 2009
1
2
3
/*
 * Page 103 of the Object-Oriented JavaScript book suggests
 * that the result of the last statement should be false.
gist: 181520 vim setting
Gravatar
Sat Sep 05 14:33:58 -0700 2009
1
2
3
" Let's say that you are copying three lines of text which are written like this
" def foo
" if true
Gravatar
Fri Aug 21 12:17:20 -0700 2009
1
2
3
  class Human
    def self.age
      @age = 50
Gravatar
Mon Aug 03 11:29:07 -0700 2009
1
2
3
    def self.setup_rails_for_action_cache_options
      ::ActionController::Caching::Actions::ActionCacheFilter.class_eval do
        def initialize(*actions, &block)
gist: 154375 a jQuery plugin base to cre...
Gravatar
Fri Jul 24 08:43:07 -0700 2009
1
2
3
// app.js
$(document).ready(function(){
    $('#calendar').calendarize({
Gravatar
Tue Jun 23 11:09:45 -0700 2009
1
2
3
# routes.rb
ActionController::Routing::Routes.draw do |map|
   map.resources :users do |user|
Gravatar
Tue Jun 23 11:05:57 -0700 2009
1
2
3
class String
  def sluggify
    slug = self.gsub(/[^\d\w\-_]/, '-').squeeze('-')
Gravatar
Tue Jun 23 10:53:27 -0700 2009
1
2
3
students
-------
INT id
Gravatar
Tue Jun 23 07:48:01 -0700 2009
1
2
3
  var highlightClass = 'hl';
  
  function createHighlights(text, regex, node,parentn) {
Gravatar
Fri Jun 19 19:43:10 -0700 2009
1
2
3
require 'rubygems'
require 'eventmachine'
 
gist: 116650 roll_searchable
Gravatar
Sat May 23 07:54:19 -0700 2009
1
2
3
class Article < ActiveRecord::Base
end
 
gist: 115660 where to place routes in pl...
Gravatar
Thu May 21 12:20:07 -0700 2009
1
2
3
-myplugin
--app
---controllers
Gravatar
Sat May 09 19:18:30 -0700 2009
1
2
3
module Shoulda # :nodoc:
  module ActiveRecord # :nodoc:
    module Matchers
Gravatar
Sat May 09 18:36:10 -0700 2009
1
2
3
module ActiveSupport
  Inflector.inflections do |inflect|
    inflect.plural(/$/, 's')
Gravatar
Mon May 04 05:05:14 -0700 2009
1
2
3
Site: localhost
cookie name: _demo_session
content: BAh7CDoPc2Vzc2lvbl9pZCIlMTI2Zjc4OGU0NjI5NzU1ZTEyMDQxY2Y5ZDUzZGZkNWI6CW5hbWUiCU1hdHoiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7AAY6CkB1c2VkewA%3D--b3bcba15977d97931e93c20ae5c6bd8a59423b21