This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def method_missing x; "Hello World"; end; puts stup; dne; "dlroW olleH"; x gnissim_dohtem fed | |
def method_missing x | |
"Hello World" | |
end | |
puts stup | |
dne | |
"dlroW olleH" | |
x gnissim_dohtem fed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('div.answer_count_row.light_gray').filter(function (index, row) { | |
return $(row).text().split("•")[1].trim() == "Free to Ask"; | |
}).map(function (index, row) { | |
return $(row).closest('div.WantedAnswerSuggestionRow').find('a.ask_to_answer')[0]; | |
}).click(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nicks = %w{ | |
lm aji brodes cbgbt dru ek horm ianweller jruby khwain | |
montgc narada rd reed suroi suscd woodrufb | |
} | |
d = File.readlines('dictionary.txt').to_a | |
puts nicks.map {|nick| | |
o = nick.downcase!.dup | |
while (results = d.select{|line| line.chomp.end_with?(nick)}).length == 0 && nick.length > 0 | |
nick = nick[1, nick.length] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expected = %w{1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz}; | |
seed = 0; | |
begin | |
puts "trying seed #{seed}" | |
r = Random.new(seed) | |
throw :nope unless (0..11).to_a.all? {|i| [i+1, "Fizz", "Buzz", "FizzBuzz"][r.rand(4)] == expected[i] } | |
puts "drusepth: Seed #{seed} will do the job just fine" | |
rescue | |
seed += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'google-search' | |
require 'thread' | |
require 'nokogiri' | |
require 'open-uri' | |
CASCADE_SNIPPETS = false | |
def method_missing method_name, *args, &block | |
result_queue = Queue.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Dear jruby, | |
# | |
# May you never have woes about rounding numbers again. | |
# | |
# Sincerely, | |
# Me | |
# Constants |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use IO::Socket; | |
use LWP::UserAgent; | |
my ($msn_username, $msn_password) = ('xjessicaxfieryx@hotmail.com', ''); | |
my ($msn_server, $msn_port) = ('messenger.hotmail.com', 1863); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use googlescraper; | |
open TOPICS, "topics.txt"; | |
my @topics = <TOPICS>; | |
close TOPICS; | |
my @urls; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use IO::Socket; | |
use LWP::UserAgent; | |
use LWP::Simple; | |
my (%_PROGRAM, %_SETTINGS, %_SYSTEM, %_DUMMY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Usage: ruby score_subreddit.rb <list of subreddits> | |
# | |
# Computes the Flesch-Kincaid grade level of the last 25 comments of the given subreddits. | |
# | |
# For example: | |
# > ruby score_subreddit.rb science worldnews funny | |
# science: 8.33 | |
# worldnews: 9.71 | |
# funny: 5.32 |