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 / maven-deps.awk
Created August 24, 2012 13:28 — forked from fs111/gist:3097209
nexus commandline search
#!/bin/bash
# command line search script for nexus instances. Needs curl and xmlstarlet
# installed.
NEXUS_URL="http://nexus.example.com/nexus/service/local/lucene/search?q="
# make sure we got exactly one param
if [ ! $# -eq 1 ]
then
@lwiechec
lwiechec / index.html
Created August 27, 2012 10:11
testing Rickshaw with D3
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
</head>
<body>
<script type="text/javascript" src="https://raw.github.com/shutterstock/rickshaw/master/vendor/d3.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/shutterstock/rickshaw/master/vendor/d3.layout.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/shutterstock/rickshaw/master/rickshaw.min.js"></script>
@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>
<!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>
1
2
3
4
5
6
7
8
10
[ -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
@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)
/**
* 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 / 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
@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;