Skip to content

Instantly share code, notes, and snippets.

View lwiechec's full-sized avatar

Lukasz Wiechec lwiechec

  • Den Haag, Nederland
View GitHub Profile
@lwiechec
lwiechec / pom.clj
Created February 3, 2017 11:19
sample pom.clj
(defmaven 'sample/csd-publisher "1.0-SNAPSHOT"
:model-version "4.0.0"
:parent [ 'sample/pom :version "LATEST" ]
:packaging "jar"
:name "Simple CSD Publisher webapp"
:url "http://goo.com/csd-publisher-web"
:properties {
:project.build.sourceEncoding "UTF-8"
@lwiechec
lwiechec / System Design.md
Created April 26, 2016 21:26 — forked from vasanthk/System Design.md
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?
@lwiechec
lwiechec / Gen.java
Created April 16, 2016 16:30 — forked from kbsriram/Gen.java
simple emacs tags generator for java source - only indexes classes and interfaces.
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.File;
import java.io.Reader;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.StreamTokenizer;
@lwiechec
lwiechec / prettydiff_generated.html
Created April 6, 2016 13:53
sample prettydiff result
<?xml version='1.0' encoding='UTF-8' ?><!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'><html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'><head><title>Pretty Diff - The difference tool</title><meta name='robots' content='index, follow'/> <meta name='DC.title' content='Pretty Diff - The difference tool'/> <link rel='canonical' href='http://prettydiff.com/' type='application/xhtml+xml'/><meta http-equiv='Content-Type' content='application/xhtml+xml;charset=UTF-8'/><meta http-equiv='Content-Style-Type' content='text/css'/><style type='text/css'>/*<![CDATA[*/#prettydiff.canvas{background:#986 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAE
/**
* Class that throttles requests. Ensures that the StartRequest cannot be called
* more than a given amount of time in any given interval.
*
* StartRequest blocks until this requirement is satisfied.
*
* TryStartRequest returns 0 if the request was cleared, or a non-0 number of
* millisecond to sleep before the next attempt.
*
* Simple usage, 10 requests per second:
@lwiechec
lwiechec / gist:50904e98eacab1e6820c
Created November 4, 2014 22:45
double every second element of the list
--
-- I didn't check the exercise, can we use take, double and drop?
--
double :: Num a => [a] -> [a]
double [] = []
double (x:xs) = [2*x] ++ take 1 xs ++ double (drop 1 xs)
[ -r "/home/luke/fun/emacs/emacs-24.3/src/config.in" ] || ( cd /home/luke/fun/emacs/emacs-24.3 && autoheader )
cd lib && make all \
CC='gcc -std=gnu99' CFLAGS='-static -v -Wl,-v,-t' CPPFLAGS='' \
LDFLAGS='-static -v -Wl,-v -Wl,-znocombreloc' MAKE='make'
make[1]: Entering directory `/home/luke/fun/emacs/emacs-24.3/lib'
rm -f alloca.h-t alloca.h && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat /home/luke/fun/emacs/emacs-24.3/lib/alloca.in.h; \
} > alloca.h-t && \
mv -f alloca.h-t alloca.h
1
2
3
4
5
6
7
8
10
<!DOCTYPE html>
<!--
possible ideas: for the proper centering of the map based on user's choice of the country
it would be cool to find the center of the country in question to get the map
properly centered.
-->
<html>
<head>
@lwiechec
lwiechec / index.html
Created December 4, 2012 14:12
Simple slideshow of RSS feed (this one using FFFOUND photo blog)
<!--
You are free to copy and use this sample in accordance with the terms of the
Apache license (http://www.apache.org/licenses/LICENSE-2.0.html)
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Slideshow</title>