This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# override I18n.translate to support default_options | |
module I18n | |
mattr_accessor :default_options | |
self.default_options = {} | |
class << self | |
def translate_with_default_options(key, options = {}) | |
translate_without_default_options(key, default_options.merge(options)) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filesMatching(folder) { (file, dir) => // looks alot like a Ruby block | |
println(file + ": " + dir) // multiple statements | |
file.endsWith(query) && dir == false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////////////////////////////////////////////////////////////////////// | |
// | |
// jquery.protect.js | |
// Copyright (c) 2010 Yardstick Software | |
// | |
// This plugin allows you protect a page from selection/copying the text. | |
// | |
// Doesn't do anything about Print Scrn, Save As... | |
// | |
/////////////////////////////////////////////////////////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sudo gem install octopi | |
require "octopi" | |
include Octopi | |
y = User.find("yegrb") | |
y.public_repo_count | |
y.followers_count | |
y.gravatar_id | |
y.name, y.company, y.location, y.login, y.email |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE MyDatabase | |
GO | |
SELECT mprod.object_id, oprod.name | |
FROM sys.sql_modules mprod | |
LEFT JOIN sys.objects oprod ON mprod.object_id = oprod.object_id | |
WHERE mprod.definition LIKE '%SearchString%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* mixins (include and extend) for simple modularization (vs. multiple inheritance or traits in other languages) | |
* innovations in the web space (haml, rack middleware, etc.) | |
* standardized around MIT and GIT | |
* no public properties (attr_accessor, etc.) | |
* open classes | |
* tooling (gem, rake) | |
* animal references (ducks, monkeys, bacon) | |
* metaprogramming (unicorns) | |
* TDD/BDD emphasis and tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem: --no-ri --no-rdoc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Copies all data from the production database and populates the staging | |
# database with the dumped data. | |
echo "Dumping production data..." | |
mysqldump --add-drop-table --add-locks -e -l ys_production > /tmp/db_prod2stage.sql | |
echo "Populating staging data..." | |
mysql -e "use ys_staging; source /tmp/db_prod2stage.sql;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rake' | |
begin | |
require 'vlad' | |
Vlad.load :scm => :git, :app => nil # use git, don't use mongrel | |
rescue LoadError | |
# do nothing (vlad/vlad-git not requird on server, | |
# unfortunately this hides the error if vlad-git isn't installed locally) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# list authors (by # of commits?) | |
git shortlog -s -n |