Skip to content

Instantly share code, notes, and snippets.

Szymon Szeliga Szeliga

Block or report user

Report or block Szeliga

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Szeliga
Szeliga / date_dimenion.sql
Last active Feb 18, 2019
Data warehouse date dimenion script
View date_dimenion.sql
CREATE SCHEMA IF NOT EXISTS dimensions;
DROP TABLE dimensions.dates;
CREATE TABLE dimensions.dates (
id SERIAL PRIMARY KEY,
date date,
@Szeliga
Szeliga / install-quake3.sh
Last active Jan 12, 2018 — forked from simonewebdesign/install-quake3.sh
Install Quake 3: Arena on a mac
View install-quake3.sh
#!/bin/bash
# Install Quake 3: Arena on a mac
# Copyright (c) 2016 simonewebdesign
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
View .vimrc
set nocompatible
filetype on
filetype off
set encoding=utf-8
let &t_Co=256
set linespace=0
set lazyredraw
set ttyfast
set autoindent " always set autoindenting on
set copyindent " copy the previous indentation on autoindenting
@Szeliga
Szeliga / leasing.rb
Created Jun 7, 2017
Koszta prowadzenia dzialalnosci
View leasing.rb
puts "Podaj dochod netto: "
total_income = gets.to_i
puts "Podaj rate leasingu netto"
leasing_payment = gets.to_i
leasing_payment_gross = (leasing_payment * 1.23).round(2)
vat = (leasing_payment_gross - leasing_payment).round(2)
puts "Rata Brutto #{leasing_payment_gross}"
puts "VAT #{vat}"
View piły.md

Rodzaje pił

Płatnice

Przeznaczone do szybkiego i zgrubnego docinania. Ważne aby zęby były hartowane, dzięki temu, piła się nie stępi. Polecane są piły typu Jet Cut od firmy Stanley, ze względu na sposób ostrzenia i hartowania.

Płatnice można klasyfikować za pomocą parametru TPI - Teeth Per Inch. W zależności od tego parametru, rozróżniamy 2 typy płatnic:

View vector-operations
## Foreword
I was always thrilled about learning new stuff, and recently that new stuff happened to be Go.
Why Go? I was hesitating between Rust, Elixir and Go. After some googling I found out that Go is the fastest of the three and the most mature one.
I've always enjoyed implementing raytracing algorithms, it is the most rewarding kind of programming, when after hours of brain-twisting programming you can see the result in a form of a beautiful, rendered image.
I've also found that implementing raytracers is the fastest way to learn a new language, because it touches on all the basic concepts:
* collections
* file I/O
@Szeliga
Szeliga / pointer_receiver.go
Last active Sep 7, 2016
02-vector-operations
View pointer_receiver.go
func (a *Vector) Add(b Vector) Vector {
a.X += b.X
a.Y += b.Y
a.Z += b.Z
return a
}
View gist:d8f60f9bccb4e0d274a2d3477c8fc3a3
create table mydata_real (id serial, date date, value text);
create table mydata_real_y2015 (check (date >= '2015-01-01' and date < '2016-01-01')) inherits (mydata_real);
create table mydata_real_y2016 (check (date >= '2016-01-01' and date < '2017-01-01')) inherits (mydata_real);
create function mydata_nope() returns trigger language plpgsql
as $f$ begin raise exception 'insert on wrong table'; return NULL; end; $f$;
create trigger mydata_nope before insert on mydata_real execute procedure mydata_nope();
create view mydata as select * from mydata_real;
@Szeliga
Szeliga / parser.rb
Last active Mar 9, 2016
Parsing UTF-16LE CSV file
View parser.rb
# Open your terminal, navigate to the folder were the book.csv file is residing
# and type irb, when the interactive ruby console launches, type in the following
# it will print first 5 ISBN-13 numbers
require 'csv'
i = 0; CSV.foreach('book.csv', headers: :first_row, encoding: 'UTF-16LE:UTF-8') { |line| break if i == 5; puts line['isbn13']; i += 1 }
View gist:02011a28af4092fa4dae
2015-11-10T10:32:06.667094+00:00 app[worker.1]: 3 TID-owedgntl8 INFO: Booting Sidekiq 3.4.2 with redis options {:url=>"redis://h:REDACTED@ec2-54-217-238-169.eu-west-1.compute.amazonaws.com:10079", :network_timeout=>5}
2015-11-10T10:32:07.827346+00:00 app[worker.1]: FATAL: sorry, too many clients already
2015-11-10T10:32:07.827358+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:655:in `initialize'
2015-11-10T10:32:07.827366+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:655:in `new'
2015-11-10T10:32:07.827367+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
2015-11-10T10:32:07.827368+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
2015-
You can’t perform that action at this time.