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]
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' |
Compiled by Stephen Ball.
Like this? I write more programming blog posts at Rake Routes
<?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. |
<?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); |
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." |
class UsingSelf | |
attr_accessor :a, :b, :c | |
def initialize(a, b, c) | |
self.a = a | |
self.b = b | |
self.c = c | |
end | |
end | |
class UsingInstance |
I hereby claim:
To claim this, I am signing this object:
lol lol | |
<o> | |
| | |
| | |
| | |
>o< "I've lost R2!" |
original = [ | |
{ a: { foo: 1 } }, | |
{ b: { foo: 2 } }, | |
{ c: { foo: 3 } }, | |
{ d: { foo: 4 } }, | |
{ e: { foo: 5 } }, | |
{ f: { foo: 6 } }, | |
{ g: { foo: 7 } }, | |
] |
require "kafka" | |
require "logger" | |
require "optparse" | |
script_name = File.basename($0, File.extname($0)) | |
default_logfile = "logs/#{script_name}.log" | |
default_offset = "latest" | |
options = {} | |
OptionParser.new do |opts| |