Skip to content

Instantly share code, notes, and snippets.

#Enable/Disable Markov Answers
command(:enable_markov) do |event|
game = Database::Game.owner(event.user.id)
next 'You aren\'t hosting any active games.' if game.nil?
next 'You can\'t modify your expanions after a game has been started!' if game.started
game.update markov: true
end
command(:disable_markov) do |event|
game = Database::Game.owner(event.user.id)
#!/usr/bin/env ruby
require 'rubygems'
require 'discordrb'
require 'yaml'
require './random.rb'
tempyaml = YAML.load_file 'quotes.yml'
r = Rand.new(tempyaml.size)
#!/usr/bin/env ruby
require 'rubygems'
require 'digest'
seed='qzyelonm'
index=-1
counter=0
def check_for_key(seed, index)
@SharaaEsper
SharaaEsper / Game1.md
Last active December 11, 2016 23:56
Pokemon Sun Nuzlocke Challenge

The starter chosen was Chadsten, the Litten. He triumphed in his first fight against the enemy Rowlet.

While exploring Route 1 our first encounter was a Pikipek. After capturing it, I've named him Gmay, and grinded some to increase the odds of everyone surviving the journey.

After battling some people around the first city, we moved on to Route 2 where we captured a Makuhita, which we named Loru. She did excellently at training against the normal types in the area.

After beating up some preschooler, Gmay evolved into a Trumbeak. Good on him.

After Loru beat up some normal types to complete the first trial, we caught Scott, a Yungoos.

@SharaaEsper
SharaaEsper / elasticsearch wizardry
Last active December 18, 2019 07:23
ES Magic
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_most_important_queries_and_filters.html
Notable fields:
@fields.program <-- Will have the container.log, for instance infra2_nova_api_os_compute_container-1a69f4e5.nova-api-os-compute
@message <-- The actual log line
@timestamp <-- Timestamp
os_level <-- log level (INFO, WARN, etc)
Structure of single-query request:
@SharaaEsper
SharaaEsper / gist:d6c95b03d293ec083b26
Created January 14, 2015 21:44
why did I do this
on :message, /^!issue[^adm] ?(.*)/ do |m, query| #[^adm] is there so !issueadm does not match.
array = query.split
if ! array[0].nil?
if array[0].downcase == "help"
if ! array[1].nil?
if array[1].downcase == "list"
m.reply "Usage: !issue list shows the IDs of all current issues. You can use these numbers with !issue id to get more information"
elsif array[1].downcase == "id"
m.reply "Usage: !issue id <id> Lists all notes regarding the issue of the ID specified. Use !issue list to get the current list of IDs"
else
@SharaaEsper
SharaaEsper / sslishard.txt
Created January 12, 2015 23:11
How I SSL
Split certs into site.com.crt and site.com.ca.crt
# ls ssl/
tmpkey www.<DOMAIN>.com.ca.crt www.<DOMAIN>.com.crt www.<DOMAIN>.com.csr www.<DOMAIN>.com.key
.ca.crt, .crt and .key are the needed files, the rest can be removed.
In /etc/httpd/conf.d/ssl.conf I commented out the default vhost (Starting with <Virutalhost> and through the rest of the file)
In /etc/httpd/conf.d/ssl.conf I added a NameVirtualHost directive. THis lets SNI work if you get more SSL sites in the future.
@SharaaEsper
SharaaEsper / raidcheck.sh
Created December 20, 2014 00:44
Raid Stuff
#!/bin/bash
#Get controller number
controller=`tw_cli show | tail -2 | head -1 | awk '{print $1}'`
#Set Email
email='[email protected]'
#Get Hostname
hostname=`/bin/hostname`
@SharaaEsper
SharaaEsper / gist:5cafc6d23509d9dc3ada
Last active August 29, 2015 14:10
Nuzlocke Rules
Da Rulez
Any Pokémon that faints is considered dead, and must be released.
The player may only catch the first Pokémon encountered in each area, and none else. If the first Pokémon encountered faints or flees, there are no second chances. If the first encounter in the area is a Double Battle in dark grass, the player may choose which of the two Pokémon they would like to catch.
While not exactly a definite rule, the general consensus is that players must also nickname all of their Pokémon, for the sake of forming stronger emotional bonds.
Also not a definite rule, but the general consensus is that a black out/white out is considered to be "game over", even if there are Pokémon left in the PC.
Brainstorm 69.0 % 4.0
Force of Will 64.2 % 3.7
Ponder 51.5 % 3.2
Misty Rainforest 47.1 % 2.9
Wasteland 41.2 % 3.3
Scalding Tarn 39.4 % 3.6
Volcanic Island 38.3 % 2.4
Flooded Strand 34.7 % 3.4
Spell Pierce 33.9 % 1.9
Polluted Delta 33.9 % 3.1