Skip to content

Instantly share code, notes, and snippets.

View mat-staszczyk's full-sized avatar

Mateusz Staszczyk mat-staszczyk

View GitHub Profile
# Abstractions
class Animal
attr_accessor :name, :age
def initialize(name, age)
@name = name
@age = age
end
end
class StudentEvaluator
attr_reader :results, :limit
def initialize(results, passing_limit)
raise ArgumentError unless results.is_a? Hash
@results = results
@limit = passing_limit.to_i
end
def perform
class CaesarCipher
ALPHABET_CAPS = ('A'..'Z').to_a
ALPHABET_NON_CAPS = ('a'..'z').to_a
attr_reader :phrase, :shift
def initialize(phrase, shift = 13)
@phrase = phrase
@shift = shift.to_i
end
@mat-staszczyk
mat-staszczyk / html5.haml
Created December 7, 2016 18:11 — forked from daz/html5.haml
html5shiv in HAML
!!!
%html{ :lang => "en" }
%head
%meta{ :charset => "utf-8" }
%title HTML5 yo
/[if lt IE 9]
%script{ :src => '//html5shiv.googlecode.com/svn/trunk/html5.js' }

Keybase proof

I hereby claim:

  • I am mat-staszczyk on github.
  • I am falka (https://keybase.io/falka) on keybase.
  • I have a public key ASDtvYBmJlsRJOYMtxoZaw6sfNlMg685OYsRdqVjWH5oXgo

To claim this, I am signing this object:

require "curses"
require "securerandom"
require "yaml/store"
module Directions
DIRECTIONS = {up: [-1,0], down: [1,0], left: [0,-1], right: [0,1]}
end
include Curses
include Directions
filename = ARGV[0]
class Analyzer
attr_reader :text
def initialize(filename)
@file = File.open(filename, "r+")
@text = generate_text
@file.close
class Fixnum
attr_accessor :arr, :result
def arr
arr = %w[ zero one two three four five six seven eight nine ]
end
def result
@@result ||= ""
end
@mat-staszczyk
mat-staszczyk / bubTest.cc
Created April 3, 2015 08:31
Bubble-sort performance test
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
// Setting of data amount
const int N = 10000;
int main()
@mat-staszczyk
mat-staszczyk / parzNieparz.cc
Created April 2, 2015 13:29
SPOJ - parzyste nieparzyste [rozwiązanie]
#include <iostream>
using namespace std;
int main()
{
int ilosc, n, f, g, tab[100];
cin >> ilosc;
for (int i = 0; i < ilosc; i++)