Skip to content

Instantly share code, notes, and snippets.

{
"public_identifier": "maciej-rakowicz-67a0312",
"profile_pic_url": null,
"background_cover_image_url": null,
"first_name": "Maciej",
"last_name": "Rakowicz",
"full_name": "Maciej Rakowicz",
"follower_count": null,
"occupation": "Principal Engineer at Snaptrip Group",
"headline": "Principal Engineer",
package handler_test
import (
"context"
"fmt"
gabs "github.com/Jeffail/gabs/v2"
"github.com/google/uuid"
"github.com/graph-gophers/graphql-go"
"github.com/stretchr/testify/assert"
"net/http"
@maciekr
maciekr / gist:317c28f8a27dce3f515f971e800b5936
Created February 1, 2022 13:51
LR API ID -> Expedia ID (staging)
our_id,original_id
10004,10581299
10005,10391536
10034,10043915
10040,10561183
10042,1052264
10071,1048193
10074,10080
10079,10097376
10094,10268076
@maciekr
maciekr / docker-compose.yml
Created October 20, 2021 15:10 — forked from seanhandley/docker-compose.yml
How To Set Up Docker For Mac (Mojave) with Native NFS
version: '2'
services:
api:
volumes:
- "nfsmount:${CONTAINER_DIR}"
volumes:
nfsmount:
driver: local
driver_opts:
id,name,breadcrumbs
g7291279,"Bridport","united-kingdom,england,dorset,west-dorset-district,bridport"
g2653989,"Callander","united-kingdom,scotland,stirling,callander"
g2655148,"Boscastle","united-kingdom,england,cornwall,forrabury-and-minster,boscastle"
g7292699,"Priors Marston","united-kingdom,england,warwickshire,stratford-on-avon-district,priors-marston"
g7301936,"Toft Monks","united-kingdom,england,norfolk,south-norfolk-district,toft-monks"
g2636432,"Swansea","united-kingdom,wales,city-and-county-of-swansea,castle,swansea"
g7296060,"Brixham","united-kingdom,england,torbay,brixham"
g2634485,"West Burton","united-kingdom,england,yorkshire-and-the-humber,north-yorkshire,richmondshire-district,burton-cum-walden,west-burton"
g2647356,"Hastings","united-kingdom,england,south-east,east-sussex,hastings-district,hastings"
@maciekr
maciekr / uninstall_gems.sh
Created September 23, 2019 16:58 — forked from IanVaughan/uninstall_gems.sh
Uninstall all rbenv gems
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}
@maciekr
maciekr / gist:e885606b60db3ad2184a1e2b590d2618
Created February 7, 2019 09:07
Ruby AWS SNS-SQS subscription with sendPermission
require 'aws-sdk-sqs'
require 'aws-sdk-sns'
sqs = Aws::SQS::Client.new(access_key_id: "-",
secret_access_key: "-",
region: ENV['AWS_REGION'] || 'eu-west-1')
queue_name = "blah-queue"
queue_url = sqs.get_queue_url(queue_name: queue_name).queue_url rescue nil
queue_url ||= begin
@maciekr
maciekr / ngx-lua.sh
Created April 19, 2017 16:16 — forked from Ryan4CN/ngx-lua.sh
Script to compile nginx on ubuntu with lua support.
#!/bin/sh
apt-get install -y libreadline-dev libncurses5-dev libpcre3-dev \
libssl-dev perl make build-essential
# Script to compile nginx on ubuntu with lua support.
NGX_VERSION='1.8.0'
LUAJIT_VERSION='2.0.4'
LUAJIT_MAJOR_VERSION='2.0'
@maciekr
maciekr / nginx.conf
Created April 4, 2017 20:25 — forked from chrisallenlane/nginx.conf
This is an nginx configuration that does the following: - Implements a RESTful API using CORS between `example.com` and `api.example.com` - Uses SSL - Reverse-proxies SSL traffic from port 443 to a NodeJS application running on port 8000 Adapted from this page, with thanks to the original author: http://enable-cors.org/server_nginx.html
# Configure the reverse-proxy on port 443
server {
# general configs
keepalive_timeout 30;
listen 127.0.0.1:443 ssl;
server_name api.example.com;
# ssl configs
ssl_certificate /path/to/api.crt;
ssl_certificate_key /path/to/api.key;
@maciekr
maciekr / base_pricer.rb
Created September 6, 2016 16:03
custom deals and vip cottages
module Pricing::Pricers
class BasePricer
PRICE_EXPIRES_IN = 12.months
attr_accessor :property, :check_in_on, :check_out_on, :reindex, :expiry, :request_live_price, :cookied, :allow_alternative_pricers
alias_method :cookied?, :cookied
alias_method :allow_alternative_pricers?, :allow_alternative_pricers
def initialize(property, check_in_on, check_out_on, reindex: true, expiry: PRICE_EXPIRES_IN,