Stephen Ball sdball

View nil_what_are_you_doing_stahp.rb
1 2 3 4 5 6 7 8 9 10
class NilWhatAreYouDoingStahp
attr_accessor :not_nil
 
def initialize
@not_nil = "I'm not nil! I'm a value!"
end
 
def wat
if not_nil.nil?
not_nil = "Ok, now I'm not nil."
View index.php
1 2 3 4 5 6 7 8 9
<?php
// page setup
require('/www/includes/ipdatabase/ipdb_page.php');
 
$javascript = '<script type="text/javascript" src="/ipdatabase/js/index.js"></script>';
 
$page = new IPDB_Page();
$page->title('Main');
$page->javascript($javascript);
View ezproxy_redirect.php
1 2 3 4 5 6 7 8 9 10
<?php
/**
* ezproxy_redirect
*
* EZProxy requires that the username and password be passed via GET.
* This is just about as insecure as possible.
*
* So, we trick ezproxy into security by opening a socket connection
* to the server; acting as a browser to initiate the connection; then
* writing out its response to the actual browser.
View javascript_learning_sources.md
View hardcoded_swap.rb
1 2 3 4 5 6 7 8 9 10
require 'minitest/spec'
require 'minitest/autorun'
 
class String
def one_time_override(method, &override)
self.instance_eval do
def to_s
self.instance_eval do
def to_s
'foo'
View deploy.rb
1 2 3 4 5 6 7 8 9 10
# drop this task in the environment(s) you want to confirm deployment for
 
before :deploy, "deploy:confirm"
 
namespace :deploy do
desc "Should we really deploy?"
task :confirm do
if Capistrano::CLI.ui.ask("Are you sure?") == "yes"
puts "You got it buddy. Imma deploy now."
else
View sandi_metz_rules_for_developers.md

Sandi Metz’ rules for developers

  1. Your class can be no longer than a hundred lines of code.
  2. Your methods can be no longer than five lines of code
  3. You can pass no more than four parameters and you can't just make it one big hash.
  4. In your controller, you can only instantiate one object, to do whatever it is that needs to be done.
  5. Your view can only know about one instance variable.
  6. Your Rails view should only send messages to that object i.e., no Demeter violations.[ "thunder dome principal". Translated: one model in, one model out! ]
  7. Rules are meant to be broken if by breaking them you produce better code. [ ...where "better code" is validated by explaining why you want to break the rule to someone else. ]
View fiat_nil.rb
1 2 3 4 5
class FiatNil
def method_missing(*args)
nil
end
end
Something went wrong with that request. Please try again.