Skip to content

Instantly share code, notes, and snippets.

@gerardszczepanski
gerardszczepanski / ticketsKata.md
Last active April 1, 2018 23:00
Tickets Reservation System Kata

Tickets Reservation System Kata

Description

Your startup company is creating big online tickets reservation system for many events (concerts, sports). Your role is to design subsystem responsible for online reservation.

You know that there will be interactive map for each event, and users will be able to reserve and buy tickets by selecting places on the map and then providing their personal details.
You must create subsystem responsible for online tickets reservation.

@armanso
armanso / AES.java
Last active March 26, 2025 05:39
AES encryption/decryption in crypto-js way, use KDF for generating IV and Key, use CBC with PKCS7Padding for Cipher
import com.sun.jersey.core.util.Base64;
import java.io.UnsupportedEncodingException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Random;
import javax.crypto.BadPaddingException;
@vasanthk
vasanthk / System Design.md
Last active May 16, 2025 07:32
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
Date: Tue, 30 Sep 2014 16:49:43 +0000
From: Louis Goff-Beardsley <[email protected]>
To: London Ruby Users Group <[email protected]>
Subject: [LRUG] [JOBS] Contracts Galore
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Hi LRUG,
Just a quick note, the yearly "Just got back from holiday, oh God we need more development done" contracts rush has come and we've been inundated with requests for upper-Mid level & Senior Ruby and/or Javascript contractors.
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 16, 2025 13:41
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@ewoutkramer
ewoutkramer / JsonTestPatient
Last active November 16, 2017 10:48
HL7 FHIR test patient in json, containing all corner cases for testing the json parser.
{
"resourceType": "Patient",
"identifier": [{
"label": "MRN",
"period": {"start": "2001-05-06"},
"assigner": {"display": "Acme Healthcare"},
"use": "usual",
"system": "urn:oid:1.2.36.146.595.217.0.1",
"value": "12345"
}],
@esfand
esfand / customdao.md
Last active February 7, 2019 07:08
Spring Custom UserDetails

How to use Custom DAO class in Spring Security

Source

  • Objective 1 : Use Custom DAO classes in Spring Security Spring Security provides mechanism by which we can specify database queries in spring security xml file , but sometimes we want to use our own custom dao classes which are already built.
  • Objective 2 : Forward the request to different home pages based on the authorized role
@avk
avk / xhr_json_post.js
Created December 9, 2011 00:48
Titanium Mobile properly serializing JSON into a query string
var url = "http://localhost:3000";
var params = {
foo: 'bar',
stuff: [1,2,3]
};
var xhr = Ti.Network.createHTTPClient({
onload: function() {
alert("load!");
},
onerror: function() {
@davist11
davist11 / Fancy File Inputs.js
Created October 25, 2010 21:32
Fancy File Inputs
var SITE = SITE || {};
SITE.fileInputs = function() {
var $this = $(this),
$val = $this.val(),
valArray = $val.split('\\'),
newVal = valArray[valArray.length-1],
$button = $this.siblings('.button'),
$fakeFile = $this.siblings('.file-holder');
if(newVal !== '') {