Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
#config/initializers/devise.rb | |
config.warden do |manager| | |
manager.strategies.add :token_header_authenticable, TokenHeaderAuthenticable | |
manager.default_strategies(:scope => :user).unshift :token_header_authenticable | |
end |
125642:ActionView::Template::Error (not opened for writing): | |
125643- 3: .sign_inner.location-selector | |
125644- 4: .selects | |
125645- 5: - selected = localiser.application_location.world? ? nil : localiser.application_location | |
125646- 6: - cache "#{localiser.locale.cache_key}/#{selected.try(:cache_key) || "w"}/main_loc_selector", expires_in: 24.hours do | |
125647- 7: = country_select selected: selected.try(:country).try(:id), class: 'combobox' | |
125648- 8: - if selected.try(:country).try(:has_children?) | |
125649- 9: = region_and_city_select selected, :class => "combobox" | |
125650- org/jruby/ext/stringio/RubyStringIO.java:992:in `write' | |
125651- org/jruby/RubyIO.java:2376:in `write' |
#!/bin/bash | |
# | |
# Install Postgres 9.2 on a clean Ubuntu 12.04 | |
""" | |
LC_ALL issue | |
comment out the AcceptEnv LANG LC_* line in the remote /etc/ssh/sshd_config file. | |
sudo apt-get install language-pack-en-base | |
sudo dpkg-reconfigure locales | |
comment out the SendEnv LANG LC_* line in the local /etc/ssh/ssh_config file. |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
Copyright: Javier de la Cueva | |
Licencia: Affero GPL V3 | |
Script para generar un archivo csv con las URLs de las páginas web | |
con las referencias de los Consejos de Ministros habidas hasta la | |
fecha de ejecución del script. Util como punto de partida para | |
*scraping* del contenido de las referencias. |
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X) | |
(if you aren't using version 9.1.5, change line 6 with the correct version) | |
1. pg_ctl -D /usr/local/var/postgres stop -s -m fast | |
2. mv /usr/local/var/postgres /usr/local/var/postgres91 | |
3. curl https://raw.github.com/fragility/homebrew/737af01178590950749cf5e841f2d086c57c5a80/Library/Formula/postgresql.rb > /usr/local/Library/Formula/postgresql.rb | |
4. brew upgrade postgresql | |
5. initdb /usr/local/var/postgres -E utf8 | |
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres | |
7. pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start |
#!/usr/bin/env python | |
import select | |
import time | |
import psycopg2 | |
import psycopg2.extensions | |
import sys | |
def get_cursor(): | |
conn = psycopg2.connect("dbname=pgpubsub") |
How much of your codebase is only understood by one person?
Have you seen this question before? If you're a programmer then you're likely to have. It's a question that is strongly related the concept of a bus factor; the minimum number of people that understand any part of a system. This question annoys me though, because by asking it you are assuming that the system in question is so complicated and ill documented that at least parts of it can only be understood by the people that created it or those who that knowledge was shared with.
Why is this the norm? Why is it that we accept complexity? Edsger Dijkstra famously said "Simplicity is prerequisite for reliability" and I don't anyone who would disagree. When we accept complexity by not striving for simplicity, we accept unreliability and bugs.
require 'java' | |
require 'flying_saucer' | |
java_import org.xhtmlrenderer.pdf.ITextRenderer | |
class PDFGenerator | |
def self.generate(html) | |
new(html).generate | |
end |
# Usage: redis-cli publish message.achannel hello | |
require 'sinatra' | |
require 'redis' | |
conns = Hash.new {|h, k| h[k] = [] } | |
Thread.abort_on_exception = true | |
get '/' do |