Skip to content

Instantly share code, notes, and snippets.

View qbart's full-sized avatar
🧀

Bartłomiej Wójtowicz qbart

🧀
View GitHub Profile
@qbart
qbart / config.yml
Last active June 17, 2018 19:13
CircleCI 2.0 config for Crystal
version: 2
jobs:
build:
docker:
- image: crystallang/crystal:0.25.0
steps:
- checkout
- restore_cache:
keys:
@qbart
qbart / heroku.md
Created June 9, 2018 21:27
heroku cli

buildpack:

heroku buildpacks:add https://github.com/crystal-lang/heroku-buildpack-crystal.git

add-on:

heroku addons:create scheduler:standard
@qbart
qbart / config.yml
Created July 14, 2018 23:33
Rails CircleCI minimal config with Postgres (using structure.sql)
version: 2
jobs:
build:
docker:
- image: circleci/ruby:2.5.1-node-browsers
environment:
RAILS_ENV: test
BUNDLE_JOBS: "3"
BUNDLE_RETRY: "3"
BUNDLE_PATH: vendor/bundle
require "./gh/*"
require "dotenv"
require "http/client"
require "json"
require "colorize"
Dotenv.load(".env.local")
class Github
BASE_URL = "https://api.github.com"
@qbart
qbart / forget.md
Last active April 8, 2020 14:40
Useful snippets that are often forgotten
postgres://USERNAME:PASSWORD@HOST:5432/dbname
mysql -h 0.0.0.0 -u wordpress -p -P 3306 -D wordpress < file.sql
@qbart
qbart / aws_alb_logging.tf
Last active October 30, 2018 13:06
AWS terraform
locals {
log_prefix = "alb.api"
}
# logs
resource "aws_s3_bucket" "logs" {
region = "${var.region}"
bucket = "${var.environment}-aws-logs"
acl = "private"
@qbart
qbart / multiple_readers.go
Last active June 4, 2020 17:59
testing buffered gorutines
package main
import (
"fmt"
"time"
)
func main() {
ch := make(chan int, 2)
@qbart
qbart / Makefile
Created June 11, 2020 23:22
Neo4j with BOLT for local development
gen_certs:
openssl genrsa -out ./tmp/private.key 2048
openssl req -new -x509 -key ./tmp/private.key -out ./tmp/public.crt -days 365
sudo mkdir -p tmp/neo4j/certs/bolt/trusted
sudo mkdir -p tmp/neo4j/certs/bolt/revoked
sudo cp tmp/private.key tmp/public.crt tmp/neo4j/certs/bolt
@qbart
qbart / docker-compose.yml
Last active November 6, 2020 01:03
Docker compose for PostgreSQL
version: '3'
services:
pg:
image: postgres:12.3-alpine
restart: always
ports:
- 5432:5432
environment:
POSTGRES_PASSWORD: secret
@qbart
qbart / errors.go
Last active September 16, 2020 00:57
Go errors
package main
type ErrorA struct{}
func (*ErrorA) Error() string {
return "ErrorA"
}
type ErrorB struct{}