Skip to content

Instantly share code, notes, and snippets.

View drusepth's full-sized avatar
💭
hacking away on notebook.ai

Andrew Brown drusepth

💭
hacking away on notebook.ai
View GitHub Profile
require 'httparty'
require 'rhymes'
rhyme_schemes = {
alternate_rhyme: 'ABAB CDCD EFEF GHGH',
ballade: 'ABABBCBC ABABBCBC ABABBCBC BCBC',
monorhyme: 'AAAA AAAA AAAA',
couplet: 'AA BB CC DD',
enclosed: 'ABBA',
limerick: 'AABBA',
rhyme_schemes = {
alternate_rhyme: 'ABAB CDCD EFEF GHGH',
ballade: 'ABABBCBC ABABBCBC ABABBCBC BCBC',
monorhyme: 'AAAA AAAA AAAA',
couplet: 'AA BB CC DD',
enclosed: 'ABBA',
limerick: 'AABBA',
terza_rima: 'ABA BCB CDC DED',
keats_odes: 'ABABCDECDE',
sonnet: 'ABAB CDCD EFEF GG'
#!/usr/bin/ruby
require 'net/http'
class Scraper
attr_reader :client
def scrape url
puts "Scraping file: #{url}"
class Character < ActiveRecord::Base
validates :name, presence: true
belongs_to :user
validates :user_id, presence: true
include BelongsToUniverse
include HasAttributes
include HasPrivacy
class Character < ActiveRecord::Base
validates :name, presence: true
belongs_to :user
validates :user_id, presence: true
include BelongsToUniverse
include HasAttributes
include HasPrivacy
require 'active_support/concern'
module HasContentGroupers
extend ActiveSupport::Concern
included do
@@relations = {}
# Example:
# relates :siblings, with: :siblingships, where: { alive: true }, type: :two_way
var roleBuilder = {
/** @param {Creep} creep **/
run: function(creep) {
if(creep.memory.building && creep.carry.energy == 0) {
creep.memory.building = false;
creep.say('🔄 harvest');
}
if(!creep.memory.building && creep.carry.energy == creep.carryCapacity) {
from hlt import *
from networking import *
my_id, game_map = getInit()
sendInit("Ankov")
def my_pieces():
pieces = []
for y in range(game_map.height):
for x in range(game_map.width):
We can't make this file beautiful and searchable because it's too large.
Name;Cost;Attack;Health;Durability;Class;Type;Effect
Amateur Blessings;1;;;;hunter;spell;Give a random friendly minion Overload (1). Draw a card.
Shade Region;8;1;;2;priest;weapon;Inspire: Give all Mechs in your hand and deck Spell Power +1 and lose 1 Durability.
Shade Shot;4;2;;1;mage;weapon;Combo: Freeze a Pirate.
Initiate Scroll;7;1;;1;hunter;weapon;Whenever your hero attacks, Give a random friendly minion +3/+1.
Shattered Calls;5;;;;warlock;spell;Destroy a minion.
Diabolic Gate;4;;;;paladin;spell;Your Dragons gain "Your Hero Power costs (1) less".
Scientist Calling;8;1;;1;neutral;weapon;Inspire: Draw 3 cards.
Jade Knight;1;10;3;;rogue;minion;Battlecry: If you have at least 8 cards in hand, Deal damage equal to this minion's Health.
Lively Book;10;;;;rogue;spell;Take control of a minion with 7 or less Health for every minion in your hand.
class EmojiService
def self.emoji_for_sentiment sentiment_score
case sentiment_score
when -5..-2.5
":'("
when -2.5..-1
":("
when -1..1
":|"
when 1..2.5