Skip to content

Instantly share code, notes, and snippets.

@laspluviosillas
laspluviosillas / Questions
Created July 12, 2011 03:05
Magma Rails Give-away
Day Job: Programmer and web designer for small outsourcing firm called Etherpros in Orizaba, Veracruz.
Open source contribution:
Nothing too big. I created FastFM which is a Filemaker (hate the technology but had to use it for a project) PHP ORM. I also host 'chayote', a simple open-source time tracking application. None of my open source projects have taken off (but to be fair I haven't promoted them much).
I've made some contributions to ThinkUp and Canvas.
Tell me about your experience with Ruby/Rails: Been using it since 09. Not only is it based on my favorite language (ruby), but I've found RoR to be the framework that best allows for agile development which keeps clients happy. I love it.
GitHub: I use it as a repo for most of my projects and to contribute to open source projects I find interesting.
strong@jstrong:~$ bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Initialized empty Git repository in /home/jstrong/.rvm/src/rvm/.git/
error: RPC failed; result=56, HTTP code = 100
class InventoriesController < ApplicationController
before_filter :authenticate_login!
def index
@page_title = "Course Administration"
@inventories = Inventory.where(:account_id => current_account.id)
.joins(:course)
.select("inventories.*, courses.name as course_name")
end
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: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
@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
# 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"