Sublime Text 2 plugin for running ruby tests! (Unit, RSpec, Cucumber)
require 'active_record' | |
require 'activerecord-import' | |
require 'benchmark' | |
require 'pg' | |
include ActiveRecord | |
Base.establish_connection adapter: 'postgresql', | |
encoding: 'unicode', | |
pool: 5, |
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
ServerName hostname.com | |
DocumentRoot /var/www/vhosts/ruby/htdocs/public | |
CustomLog /var/www/vhosts/ruby/log/access.log combined | |
ErrorLog /var/www/vhosts/ruby/log/error.log | |
<Directory "/var/www/vhosts/ruby/htdocs/public"> | |
SetOutputFilter DEFLATE |
# config/initializers/char_converter.rb | |
require 'uri' | |
module Support | |
class CharConverter | |
SANITIZE_ENV_KEYS = [ | |
"HTTP_COOKIE", # bad cookie encodings kill rack: https://github.com/rack/rack/issues/225 | |
"HTTP_REFERER", | |
"PATH_INFO", |
<?xml version="1.0"?> | |
<!-- Key Mappimgs for http://pqrs.org/macosx/keyremap4macbook/ --> | |
<root> | |
<item> | |
<name>German Umlaute on US Keyboard Layout with ALT modifier</name> | |
<appendix>Change Option+o to ö</appendix> | |
<appendix>Change Option+a to ä</appendix> | |
<appendix>Change Option+u to ü</appendix> | |
<identifier>remap.org.openhort.german_umlaute_with_ALT_modifier</identifier> |
#!/usr/bin/env sh | |
# Download lists, unpack and filter, write to stdout | |
curl -s https://www.iblocklist.com/lists.php \ | |
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \ | |
| xargs wget -O - \ | |
| gunzip \ | |
| egrep -v '^#' |
begin | |
require 'highline/import' | |
rescue LoadError | |
puts "we need highline, please run:", "", "\tgem install highline", "" | |
exit 1 | |
end | |
begin | |
require 'gh' | |
rescue LoadError |
Inheritance is a key concept in most object-oriented languages, but applying it skillfully can be challenging in practice. Back in 1989, M. Sakkinen wrote a paper called Disciplined inheritance that addresses these problems and offers some useful criteria for working around them. Despite being more than two decades old, this paper is extremely relevant to the modern Ruby programmer.
Sakkinen's central point seems to be that most traditional uses of inheritance lead to poor encapsulation, bloated object contracts, and accidental namespace collisions. He provides two patterns for disciplined inheritance and suggests that by normalizing the way that we model things, we can apply these two patterns to a very wide range of scenarios. He goes on to show that code that conforms to these design rules can easily be modeled as ordinary object composition, exposing a solid alternative to tradi
/* | |
* Grunt Task File | |
* --------------- | |
* | |
* Task: coffee | |
* Description: Compile CoffeeScript files | |
* Dependencies: coffee-script | |
* | |
*/ |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |