This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE SCHEMA IF NOT EXISTS dimensions; | |
DROP TABLE dimensions.dates; | |
CREATE TABLE dimensions.dates ( | |
id SERIAL PRIMARY KEY, | |
date date, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (a *Vector) Add(b Vector) Vector { | |
a.X += b.X | |
a.Y += b.Y | |
a.Z += b.Z | |
return a | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:[email protected]: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- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.directive 'slickCarousel', -> | |
restrict: "A" | |
link: (scope, element, attrs, ctrl) -> | |
scope.responsive = | |
breakpoint: 1024 | |
settings: | |
slidesToShow: 3 | |
slidesToScroll: 3 | |
infinite: true | |
dots: true |
NewerOlder