Skip to content

Instantly share code, notes, and snippets.

layout title author image
post
Design for Programmers
James Strong
images/design_programmers.png

Too often I encounter web programmer who want to do a small web based application by himself, but can't pull the feat off because of a complete lack of any sort of design skills. He might be trying to setup a personal blog, a website to advertise his open source library, a product, or something completely unrelated. But, with only a barebones understanding of CSS and no understanding of good design patterns, the project goes nowhere.

It is absolutely essential that every web developer know the basics of web design. You don't have to be an expert, but knowing a few of the key concepts behind web design go a long way to improving your overall skills. A web programmer who doesn't know anything about web design is like a software programmer who doesn't have the faintest clue about computer hardware. It might not be your job, but forms part of a basic skill set that is necessary to adequately perfor

@laspluviosillas
laspluviosillas / gist:5095588
Last active December 14, 2015 13:48
Routing error
I'm using the active_admin_associations gem to get this route, so the definition in routes.rb of the Gem is not that standard:
if Rails.application.config.aa_associations.autocomplete_models
models = Rails.application.config.aa_associations.autocomplete_models.join('|')
Rails.application.routes.draw do
match '/autocomplete/:model' => 'autocomplete#index', :model => /(#{models})/,
:defaults => { :format => 'json' }
end
end
@laspluviosillas
laspluviosillas / gist:5095584
Created March 6, 2013 00:05
Rake routing error
update_all_quiz_user_answers POST /quizzes/:quiz_id/user_answers/update_all(.:format) user_answers#update_all
quiz_user_answers GET /quizzes/:quiz_id/user_answers(.:format) user_answers#index
quiz GET /quizzes/:id(.:format) quizzes#show
/ :controller#:action
eebos /eebos(.:format) :controller#:action
/eebos(.:format) :controller#:action
train_sessions_traininghistory /train_sessions/traininghistory(.:format) :controller#:action
en_train_sessions_traininghistory /en/train_sessions/traininghistory(.:format) :controller#:action
fr_train_sessions_traininghistory /fr/train_sessions/traininghistory(.:format) :controller#:action
# My Rubygems file.
source 'http://rubygems.org'
gem 'rails', '3.2.8'
gem 'sqlite3', '~> 1.3.5'
gem 'rails-backbone', '~> 0.7.0'
gem 'jquery-rails'
gem 'ejs'
gem "flutie", "~> 1.3.2"
module Payroll
class Period < ActiveRecord::Base
set_table_name "payroll_periods"
has_many :fps_submissions,
:dependent => :delete_all,
:class_name => 'Payroll::FpsSubmission'
# Public: prepares a VatSubmission so it's ready for validation
#
class Adoption < ActiveRecord::Base
has_one :adopter_info, :as => :contact, :class_name => "ContactInfo"
accepts_nested_attributes_for :adopter_info
end
class ContactInfo < ActiveRecord::Base
attr_accessible :address, :email, :full_name, :phone, :state, :city, :zip
belongs_to :contact, polymorphic: true
validate :must_have_form_of_contact
@laspluviosillas
laspluviosillas / gist:5413389
Created April 18, 2013 14:56
JSON output from CoH2
{
"GameData": {
"upgrade_ext": {
"must_be_in_supply": false,
"$REF": "ebpextensions\\upgrade_ext.lua",
"standard_upgrades": {},
"number_of_standard_slots": 0.0
},
"modifier_ext": {
"$REF": "ebpextensions\\modifier_ext.lua"
def create_location_with_random_trait(options = {})
# there might be a way to retrieve this from the factory girl object directly to avoid duplicat
trait = [:trait1, :trait2, :trait3].sample
FactoryGirl.create(:location, trait, options)
end
# OR
module FactoryGirl
ActiveAdmin.register OleCore::Subscription, as: "Subscriptions" do
controller do
def scoped_collection
resource_class.includes(:account)
end
end
filter :id
index do