Skip to content

Instantly share code, notes, and snippets.

View nordringrayhide's full-sized avatar

Nodrin Grayhide nordringrayhide

  • home
  • Worldwide
View GitHub Profile
/* reset-fonts-grids.css http://developer.yahoo.com/yui/reset/#code */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
margin:0;
padding:0;
}
table {
border-collapse:collapse;
border-spacing:0;
}
http://github.com/cthulhu/by_whatever
module ByWhatever
def self.included(base)
base.send :extend, ClassMethods
end
module ClassMethods
def by_whatever(*args)
options = args.extract_options!
---
:bulk_threshold: 1000
:backtrace: false
:sources:
- http://gemcutter.org
- http://gems.github.com
- http://gems.rubyforge.org/
:benchmark: false
:update_sources: false
:verbose: true
#1) Add to your ~/.gitconfig file
#
# [core]
# excludesfile = /home/username/.gitignore
# 2) Create a ~/.gitignore file with file patterns to be ignored
# 3) Save your dot files in another repo so you have a backup (optional).
# $ mv config/database.yml config/databse.yml.example
# Remove files from tracking
/etc/network/interfaces
# DHCP
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
#STATIC IP
require 'json'
require 'open-uri'
obj = JSON.parse(open('http://uri-path/to/json/data').read)
require 'autotest/restart' # перезапускати процес при після зміни файла .autotest
require 'redgreen/autotest' # підфарбовування результатів тестів(потрібен гем redgreen)
require 'autotest/growl' # Інтеграція з системою сповіщень ОС
Autotest.add_hook :initialize do |autotest|
%w{.git .svn .hg .DS_Store ._* vendor tmp log doc .swo .swp}.each do |exception|
autotest.add_exception(exception)
end
#!/usr/bin/env ruby
Dir.glob("config/locales/*.yml") do |locale|
puts "Fixing #{locale}"
content = File.read(locale).gsub(/\{\{(.*?)\}\}/,'%{\1}')
File.open(locale, 'w') { |f| f.write content }
end
require "ya2yaml"
desc 'Create YAML test fixtures from data in an existing database.'
task 'db:fixtures:dump' => :environment do
sql = "SELECT * FROM %s"
skip_tables = ["schema_info", "schema_migrations"]
ActiveRecord::Base.establish_connection
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name|
i = "0000000"
File.open("#{RAILS_ROOT}/db/bootstrap/fixtures/#{table_name}.yml", 'w' ) do |file|