Skip to content

Instantly share code, notes, and snippets.

View tugh's full-sized avatar
:shipit:
paren-mode-on

Ertuğrul tugh

:shipit:
paren-mode-on
View GitHub Profile
@pesterhazy
pesterhazy / minimalist-migration-framerwork.sql
Created October 19, 2017 14:59
Minimalist migration framework for PostgreSQL
create table if not exists migrations (
key text CONSTRAINT pkey PRIMARY KEY
);
create or replace function idempotent(migration_name text,code text) returns void as $$
begin
if exists (select key from migrations where key=migration_name) then
raise notice 'Migration already applied: %', migration_name;
else
raise notice 'Running migration: %', migration_name;
@Andrei-Pozolotin
Andrei-Pozolotin / Atom.scala
Created June 22, 2018 16:50 — forked from kirked/Atom.scala
Clojure atoms, in Scala
/*------------------------------------------------------------------------------
* MIT License
*
* Copyright (c) 2017 Doug Kirk
*
* 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
@jdegoes
jdegoes / zio-test.scala
Last active January 6, 2023 14:08
Simple example of testing with ZIO environment
object test {
import scalaz.zio._
type UserID = String
case class UserProfile(name: String)
// The database module:
trait Database {
val database: Database.Service