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
# config/enviroment.rb | |
config.gem 'mongo' | |
config.gem 'mongo_mapper' | |
# remove AR | |
config.frameworks -= [ :active_record, :active_resource ] |
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
# a simple/configurable rake task that generates some random fake data for the app (using faker) at various sizes | |
# NOTE: requires the faker or ffaker gem | |
# sudo gem install faker - http://faker.rubyforge.org | |
# OR | |
# sudo gem install ffaker - http://github.com/EmmanuelOga/ffaker | |
require 'faker' | |
class Fakeout |
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
describe "GET current" do | |
before do | |
@request.cookies['hidden_notices'] = "1,#{notices(:permanent).id}" | |
get :current, :format => 'js' | |
end | |
it { should respond_with(:success) } | |
it { should set_cookie(:hidden_notices).to("#{notices(:permanent).id}") } | |
it { should render_template('notices/current') } | |
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
module BootstrapPaginationHelper | |
class LinkRenderer < WillPaginate::ActionView::LinkRenderer | |
protected | |
def page_number(page) | |
unless page == current_page | |
link(page, page, :rel => rel_value(page)) | |
else | |
link(page, "#", :class => 'active') | |
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
Hi David, | |
I came across your profile online and wanted to reach out about Development | |
Opportunities here at Groupon. The company is growing, and we're always | |
looking for folks with solid skills that can make positive contribution to | |
our continued success. Any chance you'd be open to a quick conversation | |
about opportunities, or for any possible networking potential? If so, let me | |
know when you're free and we can set up a time to chat. Also, if you are | |
interested, it would be great if you could forward a current resume over | |
that I can take a look at. I look forward to hearing back from you! Please | |
let me know if you have any questions. |
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
FIXME: | |
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8 | |
or | |
libxml_ruby.bundle: dlsym(0x10fde1900, Init_libxml_ruby): symbol not found | |
gem uninstall nokogiri libxml-ruby | |
brew update | |
brew uninstall libxml2 |
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 'logger' | |
class ColoredLogger < Logger | |
WHITE = "\e[37m" | |
CYAN = "\e[36m" | |
MAGENTA = "\e[35m" | |
BLUE = "\e[34m" | |
YELLOW = "\e[33m" | |
GREEN = "\e[32m" | |
RED = "\e[31m" | |
BLACK = "\e[30m" |
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 'logger' | |
class ColoredLogger < Logger | |
WHITE = "\e[37m" | |
CYAN = "\e[36m" | |
MAGENTA = "\e[35m" | |
BLUE = "\e[34m" | |
YELLOW = "\e[33m" | |
GREEN = "\e[32m" | |
RED = "\e[31m" | |
BLACK = "\e[30m" |
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
# SSL self signed localhost for rails start to finish, no red warnings. | |
# 1) Create your private key (any password will do, we remove it below) | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
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/bash | |
# Accept already established connections (so it doesnt drop your current SSH session) | |
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
# Accept SSH connections from anywhere | |
iptables -A INPUT -p tcp -i eth0 --dport ssh -j ACCEPT | |
# (Optional) Accept HTTP connections from anywhere | |
iptables -A INPUT -p tcp -i eth0 --dport 80 -j ACCEPT |
OlderNewer