Compiled by Stephen Ball.
Like this? I write more programming blog posts at Rake Routes
- JavaScript Garden [guide]
- JavaScript Enlightenment [book]
- JavaScript Koans [codebase]
- Run JavaScript Koans on Cloud9 [blog post]
| 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." |
| <?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); |
| <?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. |
Compiled by Stephen Ball.
Like this? I write more programming blog posts at Rake Routes
| 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' |
| # 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 |
| class FiatNil | |
| def method_missing(*args) | |
| nil | |
| end | |
| end |