Skip to content

Instantly share code, notes, and snippets.

tomekc / human_readable_id_base32.go
Last active Mar 16, 2021
Build human-readable ID using Base32 in Go
View human_readable_id_base32.go
package main
import (
func main() {
id := 202790
tomekc / ps-export-layers-to-png.jsx
Created Jun 7, 2012
Photoshop script that exports to PNG all layers and groups whose names end with ".png".
View ps-export-layers-to-png.jsx
#target photoshop
// $.level = 2;
* Script by Tomek Cejner (tomek (at) japko dot info)
* based on work of Damien van Holten:
* My version adds support of nested layer groups,
* and exports single layers in addition to groups.
tomekc / .vimrc
Last active Jul 9, 2020
Vim awesome plugins
View .vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on
set t_Co=256
set background=dark
colorscheme lost-shrine
set cul
tomekc / database.go
Created Jul 3, 2020
Trivial REST API returning contents of database
View database.go
package main
import (
_ ""
. "strings"
tomekc / nested-for-loops.js
Created Feb 16, 2020
Zagnieżdżone pętle for w JavaScripcie
View nested-for-loops.js
// Odpowiednik enuma w TypeScripcie
let ProjectType = {
let projectsOfUser1 = [
{ name: 'Proj1', type: ProjectType.CURRENT },
tomekc / scene-template.lua
Created Dec 10, 2019
Corona SDK - scene template
View scene-template.lua
-- Include modules/libraries
local composer = require "composer"
-- Variables local to scene
-- Create a new Composer scene
local scene = composer.newScene()
tomekc / AppDelegate.swift
Created Jan 9, 2015
CoreData snippet to add to existing project
View AppDelegate.swift
// MARK: - Core Data stack
lazy var applicationDocumentsDirectory: NSURL = {
// The directory the application uses to store the Core Data store file. This code uses a directory named "net.japko.EmptyCoreDataSwiftProject" in the application's documents Application Support directory.
let urls = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)
return urls[urls.count-1] as NSURL
lazy var managedObjectModel: NSManagedObjectModel = {
// The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model.
tomekc / promises_branching.js
Created Aug 22, 2017
Branching inside promise chain (JavaScript, Bluebirdjs)
View promises_branching.js
var Promise = require('bluebird');
console.log('=== Branching promises demo ===');
function getNameById(id) {
return Promise.resolve("Ziutek");
Add missing data to object.
View noise_level_meter.ino
#include <ESP8266HTTPClient.h>
#include <ESP8266WiFi.h>
const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz)
unsigned int sample;
#define BLINK_LED 16
#define WIFI_LED_PIN 16
#define NUM_MEASURES 1200 // Sampling freq. is 20 hz

Starcie monolitu i mikroserwisów

Obrona monolitu

Artykuł - Dan Haywood: In defence of Monolith Wyważone porównanie obu podejść. Część 2

Monolit musi być dobrze zmodularyzowany by był utrzymywalny. Prawdopodobnie większość monolitów taka nie jest.

Monolit dobrze się sprawdza w złożonej domenie biznesowej, mikroserwisy błyszczą tam, gdzie jest wielka skala.