Skip to content

Instantly share code, notes, and snippets.

Piotr piotr-galas

  • Teamtailor
  • Kraków Poland
Block or report user

Report or block piotr-galas

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
View async_await_explanation.js
class A{
const {t} = this.props;
new Api('/nurses/area').post(this.prepareData())
.then(response => {
if(response.status === 200){
response.json().then(json => {
popupTitle: t('area.success.title'),
View base_class.rb
require 'pry'
# TASK: Implement this class to make tests pass
class BaseClass
attr_reader :errors
VALIDATORS = %i[presence_of_validator numericality_validator].freeze
def self.validates_presence_of(name)
@presence_of_attr = name
View concurency_example.rb { do
while !@objects.empty?
object = @objects.pop
@mutex.synchronize do
print "#{"%H:%M")} - Saving data: #{@objects.length} items left. "
print "\r"
piotr-galas / capistrano deploy from zero
Last active Mar 29, 2017
It shows steps to configure deploy with capistrano on almost empty server (OVH) ubuntu
View capistrano deploy from zero
# add key to authorized keys:
1. create file `.ssh/authorized_keys` on server, then on local machine:
`cat ~/.ssh/ | ssh -p 5555 'cat >> .ssh/authorized_keys'`
2. Check if it possible to login without password
# base capistrano config
View .gitconfig
name = Piotr
email =
default = current
ui = auto
branch = auto
diff = auto
interactive = auto
View example_of_makro.rb
class Validator
def self.presence(value, *fields)
puts value
puts fields
class Product
def self.validates(*params)
View job_application.rb
module Filters
class Arrays
initialize(filterad_array, pattern)
@filteredArray = filteredArray
@pattern = pattern
def fromPrimeCount
if validateInputs?
View actioncable example
upstream action {
server unix:/srv/www/development/action-cable/tmp/sockets/puma.sock fail_timeout=0;
server {
keepalive_timeout 5;
root /srv/www/development/action-cable/public;
client_max_body_size 4G;
location / {
try_files $uri @action;
piotr-galas / preferences.sublime-settings
Created May 28, 2016
settings for sublime to dark theme with icons
View preferences.sublime-settings
"Seti_sidebar_font_size_14": true,
"Seti_tab_font_12": true,
"caret_extra_bottom": 3,
"caret_extra_top": 3,
"caret_extra_width": 2,
"color_scheme": "Packages/User/SublimeLinter/Oceanic Next (SL).tmTheme",
piotr-galas / payment.php
Last active Oct 6, 2015
wery bad code _postPayment
View payment.php
public function _postPayment( $data ) {
$app =JFactory::getApplication();
$html = "";
$get = $app->input->get->get('status', false);
if ( (bool) $get ) {
You can’t perform that action at this time.