Skip to content

Instantly share code, notes, and snippets.

puts "Min?"; @minimum = gets.chomp.to_i; @base = @minimum
puts "Max?"; @maximum = gets.chomp.to_i; @guesses = 0
def search(min, max)
guess = min + (max - min) / 2
puts guess
answer(min, max, guess)
end
def answer(min, max, guess)
characters = ('a'..'z').to_a + ('0'..'9').to_a + ["!", "@", "#", "$", "%", "^", "&", "*",]
password = ""
print "How long should your password be? "
len = gets.chomp.to_i
len.times{n = rand(0..43); password += characters[n].to_s;}
puts password
#!/bin/bash
echo 'Installing Gnome...'
sudo apt-get install gnome-terminal
echo "Done"
echo 'Installing cURL...'
sudo apt-get install curl
echo 'Done'
"Allow syntax highlighting based on filetype
filetype plugin indent on
syntax on
"Convert tabs to spaces. 1 tab = 2 spaces
set tabstop=8 softtabstop=0 expandtab shiftwidth=2 smarttab
"Enable pathogen plugins
execute pathogen#infect()

Keybase proof

I hereby claim:

  • I am alexdovzhanyn on github.
  • I am alexdovzhanyn (https://keybase.io/alexdovzhanyn) on keybase.
  • I have a public key ASBAi58lSBUGFurq4J9mi0uQTHe_YWvfsdGE2xRmHdI4sAo

To claim this, I am signing this object:

@alexdovzhanyn
alexdovzhanyn / git-delay.sh
Last active August 14, 2024 20:56
Shell script to delay a git commit + push until a later time
#!/bin/bash
# Shell script to delay a git commit + push until a later time. Useful for making sure code gets pushed when you want it
# even if you're away.
#
# This will commit with the given commit message after the specified amount of time has passed.
# It will push to the current branch.
days=0
hours=0