Skip to content

Instantly share code, notes, and snippets.

View clockworkpc's full-sized avatar

Alexander Garber clockworkpc

View GitHub Profile
@clockworkpc
clockworkpc / clear_screen.rb
Created May 2, 2017 06:07
Cross Platform clean_screen method in pure Ruby
def clear_screen()
puts "Going to clear the screen"
if RUBY_PLATFORM =~ /win32|win64|\.NET|windows|cygwin|mingw32/i
system('cls')
else
system('clear')
end
end
@clockworkpc
clockworkpc / lithuanian_vowels_consonants_diacritics_accents_combined_with_stripped_accents.rb
Last active April 28, 2017 13:10
Lithuanian Vowels and Consonants with Diacritics and Accents Combined
@lithuanian_letters_diacritics_and_accents = {
"a" => ["\u0061", "a"],
"ã" => ["\u00e3", "a"],
"à" => ["\u00e0", "a"],
"á" => ["\u00e1", "a"],
"ą" => ["\u0105"],
"ą̀" => ["\u0105\u0300", "ą"],
"ą́" => ["\u0105\u0301", "ą"],
"ą̃" => ["\u0105\u0303", "ą"],
"e" => ["\u0065"],
@clockworkpc
clockworkpc / get_character.rb
Last active April 27, 2017 22:19 — forked from O-I/get_character.rb
Ruby Character to Unicode Converter
def get_character(hexnum)
char = ''
char << hexnum.to_i(16)
end
@clockworkpc
clockworkpc / city_grid.rb
Created March 6, 2017 02:11
City Grid with Positive and Negative Values for X and Y Coördinates
module CityNavigation
class CityGrid
def initialize(latitude, longitude)
@latitude = latitude
@longitude = longitude
end
def valid_location?(east, north)
(-@latitude...@latitude).cover?(east)
@clockworkpc
clockworkpc / table_with_positive_values_only.rb
Last active March 6, 2017 02:00
Create a Table with Positive Values Only
module ToyRobot
class Table
def initialize(width, length)
@width = width
@length = length
end
def valid_location?(east, north)
(0...@width).cover?(east) &&
(0...@length).cover?(north)
@clockworkpc
clockworkpc / ruby_project_skeleton_generator.rb
Last active December 26, 2016 09:19
Ruby Project Skeleton Generator
## Basic Ruby Project Skeleton Generator
class Project
def initialize()
puts "What do you want to call this project?\n"
print "> "
$user_input = $stdin.gets.chomp
end
@clockworkpc
clockworkpc / Gist
Created December 1, 2016 01:55
Music Fetcher for freemusicarchive.org (Created 2011-04-02)
#!/usr/bin/python
#musicfetcher_v03.py
#Released under a GPLv3 Licence by Clockwork PC
import os
import fileinput
import string
number = int(raw_input("""
@clockworkpc
clockworkpc / keybase.md
Created November 29, 2016 02:55
Keybase

Keybase proof

I hereby claim:

  • I am clockworkpc on github.
  • I am alexandergarber (https://keybase.io/alexandergarber) on keybase.
  • I have a public key whose fingerprint is C825 FB98 CA3B 006E A33B 794E 96DE B637 80E4 4625

To claim this, I am signing this object: