Skip to content

Instantly share code, notes, and snippets.

Avatar
👻
there is more to life than coding

Ashish Dixit tundal45

👻
there is more to life than coding
View GitHub Profile
View 1.9.3-p484-railsexpress.md

ruby-1.9.3-p484 cumulative performance patch for rbenv

(I guarantee nothing. No warranty I am not responsible blah blah blah. Seems to work great for me so far. Thanks to Stanley Stuart who I forked this form & updated for p484 who originally forked it from Tyler Bird for p392)

This installs a patched ruby 1.9.3-p484 with the railsexpress patchsets: https://github.com/skaes/rvm-patchsets

Requirements

View 1.9.3-p392-railsexpress.md

ruby-1.9.3-p392 cumulative performance patch for rbenv

(I guarantee nothing. No warranty I am not responsible blah blah blah. Seems to work great for me so far. Thanks to Tyler Bird who I forked this from.)

This installs a patched ruby 1.9.3-p392 with the railsexpress patchsets: https://github.com/skaes/rvm-patchsets

Requirements

View update_vim_plugins
#!/bin/bash
echo "Bash version ${BASH_VERSION}..."
current_dir = `pwd`
cd ~/.vim/bundle
for plugin in `ls ~/.vim/bundle`
do
echo "Updating $plugin"
View string_test.rb
require 'test/unit'
class StringTest < Test::Unit::TestCase
def test_plus_equals_creates_new_object
original_string = "Hello, "
hi = original_string
assert_equal original_string.object_id, hi.object_id
there = "World"
hi += there
View array_test.rb
require 'test/unit'
class ArrayTest < Test::Unit::TestCase
def test_plus_equals_creates_new_object
original_string = ["Hello"]
hi = original_string
assert_equal original_string.object_id, hi.object_id
there = ["World"]
hi += there
View objects_for_ten_year_olds.markdown

Object Oriented Programming explained to 10 year olds

By Morgan Prior & Ashish Dixit

Objects are things that you can see around you. The chair is an object. The toys you have are objects. Robots are objects. Objects can be defined based on how they look and what they can do. For example, you can define a car as a red car or a fast car. When you say red, you are talking about physical features and when you say fast, you are talking about their abilities.

Objects form different groups based on their similarities & differences. Car is one kind of object while Robots are another. Within Robots there are household robots like the roomba that vaccums your carpet then there are cooler robots like the transformers. However, both transformers and the roomba in your house share certain similarities. So you can say that both roomba & Transformers inherit certain characteristics that are common to all robots and have additional features that separate them apart.

N

@tundal45
tundal45 / inject.rb
Created Jan 24, 2011
an example of inject with some Johnny Cash flavor
View inject.rb
places = %w( Reno Chicago Fargo Minnesota Buffalo Toronto Winslow Sarasota
Wichita Tulsa Ottawa Oklahoma Tampa Panama Mattawa La Paloma
Bangor Baltimore Salvador Amarillo Tocapillo Baranquilla and
Perdilla)
puts places.inject("I've been to: ") { |result, place| "#{result}#{place}, " } + "I'm a killer"
View parse_line.rb
@days << parse_line(line) if in_data_section && line.strip.match(/^\d/)
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Puzzlenode</title>
<link rel="stylesheet" href="css/style.css" type="text/css" />
</head>
<body>
<header id="banner">
<h1>PuzzleNode</h1>
@tundal45
tundal45 / .vimrc
Created Nov 7, 2011
My Vim Configuration
View .vimrc
set nocompatible " explicitly get out of vi compatibility mode
set number " enable line numbers
set ruler " always show current position on the status line
syntax on " turn syntax highlighting on
set encoding=utf-8
" Whitespace related
set nowrap