Skip to content

Instantly share code, notes, and snippets.

View WhereIsX's full-sized avatar

YANA WhereIsX

View GitHub Profile
@WhereIsX
WhereIsX / crystal_compiler_wat
Created April 29, 2021 21:17
crystal compiler can't deduce that all values of uint is handled
arg_size = args.size.to_u
# wrong number of arguments
if arg_size == 0 || arg_size > 2
next "wat. try #{Command.all["!feed"].description}"
end
ducky = Ducky.find_by(username: args.first.downcase)
# cant find ducky to feed
if ducky.nil?
next "hmm.. #{args.first} should !start_record to recieve feed"
204 | result = HTTP::Client.get(
^--
Error: no overload matches 'HTTP::Client.get', path: String, headers: HTTP::Headers, form: Hash(String, String)
Overloads are:
- HTTP::Client.get(url : String | URI, headers : HTTP::Headers | ::Nil = nil, body : BodyType = nil, tls : TLSContext = nil)
- HTTP::Client.get(url : String | URI, headers : HTTP::Headers | ::Nil = nil, body : BodyType = nil, tls : TLSContext = nil, &block)
- HTTP::Client.get(url, headers : HTTP::Headers | ::Nil = nil, tls : TLSContext = nil, *, form : String | IO | Hash)
- HTTP::Client.get(url, headers : HTTP::Headers | ::Nil = nil, tls : TLSContext = nil, *, form : String | IO | Hash, &block)
__D< crystal -v
MIN = 60
def brb
puts 'time?'
time = gets.to_i
(0..time*MIN).reverse_each do |t|
system("clear")
minutes = t / MIN
seconds = t % MIN

Keybase proof

I hereby claim:

  • I am whereisx on github.
  • I am where_is_x (https://keybase.io/where_is_x) on keybase.
  • I have a public key ASDetR1hnQtQXtPw9nVjnJ1o-On20d5MKWjT3zfVYQtLygo

To claim this, I am signing this object:

@WhereIsX
WhereIsX / TicTacToe.rb
Last active August 6, 2019 19:29
Yana's OO TicTacToe: first attempt, a bit wet in some places, but in working order.
class Game_Master
attr_accessor :player1, :player2, :board, :winner, :whose_turn
def initialize
@player1 = nil
@player2 = nil
@board = Board.new(3,3)
@winner = nil
@whose_turn = nil
@WhereIsX
WhereIsX / PigLatinizer.rb
Created March 15, 2019 02:30
pig latinizer
require 'pry'
class PigLatinizer
def piglatinize(input)
# pig-latinizes for more than one word
# for piglatinizer of individual words, see scramble
# binding.pry
input.split.collect{ |word| scramble(word) }.join(" ")
end