Skip to content

Instantly share code, notes, and snippets.

tomekc / CoronaSDK-Module.lua
Created Dec 4, 2015
Creating modules in Corona SDK
View CoronaSDK-Module.lua
local M = {}
function M.create()
-- initialize members: = "bar"
return M
tomekc / pom.xml
Last active Dec 11, 2015
Dropwizard bootstrap POM.
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi=""
tomekc / absurd_rest_service.js
Created Jul 4, 2013
Before running, install express by running npm install express and run with: node absurd_rest_service.js in this script's directory. Then: To submit calculation to curl -i -H "Content-Type: application/json" -d '{ "operation" : "+", "operands" : [ 2,3] }' http://localhost:3000/calculations To see results, use link from response: curl http://loca…
View absurd_rest_service.js
Before running, install express by running
npm install express
and run with:
node absurd_rest_service.js
in this script's directory.
tomekc / .gitignore
Created Nov 24, 2013
.gitignore for Xcode and AppCode projects. Collected from internet's collective wisdom :]
View .gitignore
# xcode noise
tomekc / Game.h
Created Dec 13, 2013
Sparrow Framework 2.0 boilerplate
View Game.h
#import <Foundation/Foundation.h>
#import <Sparrow-Framework/Sparrow.h>
@interface Game : SPSprite
tomekc / bmf.lua
Last active Jan 1, 2016
Bitmap font support in Corona SDK, compatible with Graphics 2.0
View bmf.lua
module( ..., package.seeall )
-- AngelCode bitmap font support
-- Updated for Graphics 2.0
-- Download sprite module from
local sprite = require( "sprite" )
-- Specify an Angelcode format bitmap font definition file (".FNT")
-- The spritesheet(s) that this file references need to be located in the resource directory.
tomekc / learn_bluebird.js
Last active Mar 15, 2016
Learning playground for Bluebird.js
View learn_bluebird.js
// npm install bluebird
// npm install superagent
var Promise = require('bluebird');
var request = require('superagent');
console.log('Promises with Bluebird');
function get(url) {
tomekc / Optional+getOrElse.swift
Last active Oct 28, 2016
Add .getOrElse() method to Swift's Optional<T>, to unwrap value with fallback to default value. Idea borrowed from Scala language.
View Optional+getOrElse.swift
// An extension to Optional type:
// getOrElse() will return optional's value if exists, otherwise the default value provided as argument will be returned.
// Note: Since Xcode6 beta 5, you can use '??' operator.
// (c) Tomek Cejner 2014
// @tomekcejner
extension Optional {
func getOrElse(val:T) -> T {
if self != nil {

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.

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