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 adjective | |
['Incredible', 'Unstoppable', 'Unflappable', 'Amazing', 'Scrumtrilescent'].shuffle[0] | |
end | |
def pronoun | |
['Man', 'Woman', 'Boy', 'Girl'].shuffle[0] | |
end | |
def animal |
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
#define a method for each part of speech that returns a word at pseudorandom | |
def adjective | |
#we get the 0th (first) element of the array after it has been shuffled, resulting in a sort of random selector | |
['Incredible', 'Unstoppable', 'Unflappable', 'Amazing', 'Scrumtrilescent', 'Purple', 'Bioluminescent'].shuffle[0] | |
end | |
def pronoun | |
['Man', 'Woman', 'Boy', 'Girl'].shuffle[0] | |
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
380,Small Shield Extender II | |
394,Shield Recharger II | |
400,Small Shield Booster II | |
406,Micro Shield Transporter II | |
438,1MN Afterburner II | |
440,1MN MicroWarpdrive II | |
448,Warp Scrambler II | |
482,Miner II | |
519,Gyrostabilizer II | |
527,Stasis Webifier II |
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
class Integer | |
def is_prime? | |
return false if self <= 1 | |
2.upto(Math.sqrt(self).to_i) { |x| return false if self % x == 0 } | |
true | |
end | |
end | |
Math.sqrt(600851475143).to_i.downto(2) { |n| puts n if n.is_prime? && 600851475143 % n == 0 } |
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
drone_behavior = (o) -> | |
{torque, thrust} = o.lib.targeting.simpleTarget o.me, ship.pos if not ship.friendly && ship.queen for ship in o.ships |
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/env python | |
# -*- coding: utf-8 -*- | |
import requests, time, sys, urllib, hashlib | |
def flash(color,text,times): | |
sys.stdout.write(text) | |
line1 = "\x0d\x1b[2K%s%s" % (color,text) | |
line2 = "\x0d\x1b[2K%s%s" % (clear,text) | |
for x in range(0,times): |
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
#Simple DoS/DDoS script in ruby | |
#don't use this on servers you don't own. | |
#don't blame me if you ignore the above and do something illegal. | |
#todo: add intelligent port rotation on failure | |
require 'socket' | |
include Socket::Constants | |
num_threads = 8 | |
num_connections = 16 |
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
#define a fibonacci enumerator | |
fibonacci = Enumerator.new do |yielder| | |
a = b = 1 | |
loop do | |
yielder << a | |
a, b = b, a + b | |
end | |
end | |
#curry cache to infinity |
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
########################################################### | |
# How many ig'nant people have named their child some # | |
# version of "Khaleesi" (which is just an honorific, # | |
# similar to "queen" - her name is Daenerys Targaryen) # | |
########################################################### | |
#SPOILER ALERT: It's over 900. | |
#Commands: |
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
import sys | |
if len(sys.argv) == 3: | |
names = sys.argv[1].split('.') | |
name_space = '.'.join(names[0:-1]) | |
caller = names[-2] | |
class_name = names[-1] | |
method_file = sys.argv[2] | |
#import from names as strings | |
test_lib = __import__(name_space) | |
methods = __import__(method_file) |
OlderNewer