Skip to content

Instantly share code, notes, and snippets.

@dx7
dx7 / gist:4260217
Created December 11, 2012 16:50
In the Beginning was the Command Line - by Neal Stephenson
In the Beginning was the Command Line
by Neal Stephenson
About twenty years ago Jobs and Wozniak, the founders of Apple, came up with the very strange idea of selling information processing machines for use in the home. The business took off, and its founders made a lot of money and received the credit they deserved for being daring visionaries. But around the same time, Bill Gates and Paul Allen came up with an idea even stranger and more fantastical: selling computer operating systems. This was much weirder than the idea of Jobs and Wozniak. A computer at least had some sort of physical reality to it. It came in a box, you could open it up and plug it in and watch lights blink. An operating system had no tangible incarnation at all. It arrived on a disk, of course, but the disk was, in effect, nothing more than the box that the OS came in. The product itself was a very long string of ones and zeroes that, when properly installed and coddled, gave you the ability to manipulate other very long strings of o
@dx7
dx7 / guitar.rb
Created November 2, 2012 15:37 — forked from caike/guitar.rb
update attribute
# update_attribute
guitar.update_attribute(:state, 'used')
# method on model
class Guitar
def mark_as_used
self.state = 'used'
self.save
@dx7
dx7 / gist:3669571
Created September 7, 2012 21:00
Ruby with PHP Feelings
# Ruby Ree 1.8.7
$ irb
ree-1.8.7 irb> 80 * "#"
TypeError: String can't be coerced into Fixnum
from (irb):1:in `*'
from (irb):1
ree-1.8.7 irb> "#" * 80
=> "################################################################################"
Bem interessante esse iGist. A acho que eh uma maneira bem simples de escrever textos e compartilhar via iphone.
@dx7
dx7 / gist:2978998
Created June 23, 2012 16:57
Macbook Especificações
Macbook White Unibody 13-inch
Processor: 2.26 GHz Intel Core 2 Duo
Memory: 4 GB 1333 MHz DDR3
Graphics: NVIDIA GeForce 9400M 256 MB
Software: Mac OS X Lion 10.7.3
HD: 250 GB SATA Disk
VENDIDO
@dx7
dx7 / gist:2930888
Created June 14, 2012 15:05
Uninstalling all ruby gems
gem list --local --no-versions | xargs gem uninstall -a -x
@dx7
dx7 / gist:2511153
Created April 27, 2012 17:44
Install Ruby 1.9.2 with rvm without remove Xcode 4.3
# Run:
# bash < <(curl -Ls https://raw.github.com/gist/2511153)
# Source: http://caiustheory.com/install-gcc-421-apple-build-56663-with-xcode-42
echo "Grab and unpack the tarball."
mkdir ~/tmp && cd ~/tmp
curl -O http://opensource.apple.com/tarballs/gcc/gcc-5666.3.tar.gz
tar zxf gcc-5666.3.tar.gz
cd gcc-5666.3
@dx7
dx7 / gist:2031859
Created March 13, 2012 21:39
You CAN inherit from a Rails::Application child!
class Settings < YourAppName::Application
end
# The Problem:
# ==> .../.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:12:in `inherited':
# You cannot inherit from a Rails::Application child (RuntimeError)
# Because:
# http://apidock.com/rails/Rails/Application/Configurable/ClassMethods/inherited
# Rspec formatter by RAFAELDX7
# Use: rspec --require "dx7_formatter.rb" --format Dx7Formatter -- ./spec/your_spec.rb
require 'rspec/core/formatters/base_text_formatter'
class Dx7Formatter < RSpec::Core::Formatters::BaseTextFormatter
def index
@index ||= -1
@index += 1
@dx7
dx7 / .inputrc
Created January 11, 2012 23:15
.inputrc
# my .inputrc file
# allow you to start typing a command and use the up/down arrow to auto complete from commands in your history
"\e[B": history-search-forward
"\e[A": history-search-backward