Skip to content

Instantly share code, notes, and snippets.

View ilkka's full-sized avatar
:octocat:
sanitary deeds done at reasonable prices

Ilkka Poutanen ilkka

:octocat:
sanitary deeds done at reasonable prices
View GitHub Profile
@ilkka
ilkka / README.md
Created April 1, 2015 10:54
GitLab + Jenkins in one command

GitLab + Jenkins in one command

$ docker-compose up

Here's a Docker Compose config file that'll give you Gitlab (SSH on 10022, HTTP on 10080) and Jenkins (HTTP on 10081) running and connected. Just add the GitLab CI and Git plugins to Jenkins and you're good to go.

Note that when setting Jenkins as your GitLab CI on the GitLab side, you have to use the container's IP since the link only goes the other way. Also GitLab can't send emails as is, I'm working on that.

@ilkka
ilkka / Dockerfile
Created March 27, 2015 08:34
Tunneling to an IP-restricted backend with Docker Compose
FROM ubuntu:14.04
MAINTAINER Ilkka Laukkanen <ilkka@ilkka.io>
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y autossh
EXPOSE 9001
EXPOSE 9002
// IndexComponent.jsx
var Index = React.createClass({
propTypes: {
products: React.PropTypes.array.isRequired
},
getDefaultProps: function getDefaultProps() {
return {
products: []
};
@ilkka
ilkka / Timer-test.js
Created November 4, 2014 11:44
Jest + React + Gulp
// app/scripts/ui/__tests__/Timer-test.js
/** @jsx React.DOM */
jest.dontMock('../Timer');
describe('Timer', function () {
var Timer = require('../Timer');
var React = require('react/addons');
var TestUtils = React.addons.TestUtils;
@ilkka
ilkka / keybase.md
Created September 30, 2014 17:42
Keybase.io proof

Keybase proof

I hereby claim:

  • I am ilkka on github.
  • I am ilkka (https://keybase.io/ilkka) on keybase.
  • I have a public key whose fingerprint is C63C E57F 6A94 9A15 5E23 C4C0 439F A002 AE5D 46DA

To claim this, I am signing this object:

@ilkka
ilkka / .zshrc
Created June 25, 2014 07:35
Linux / Mac battery level in zsh right side prompt
...
if [[ -r $HOME/.zshstuff/batterylevel.py ]]; then
RPROMPT="$RPROMPT $(python $HOME/.zshstuff/batterylevel.py)"
fi
# Bonus! Indicator of stopped (^Z'd) jobs
function stopped_jobs(){
if [[ "$(jobs)" =~ "suspended" ]]; then
import java.util.concurrent.Callable
import com.android.build.gradle.BasePlugin
import java.util.regex.Pattern
apply plugin: 'android'
apply plugin: RobolectricPlugin
class RobolectricPlugin implements Plugin<Project> {
public static final String ANDROID_PLUGIN_NAME = "android";
@ilkka
ilkka / 0001-Change-references-to-.so-libs-to-.dylib.patch
Created November 19, 2013 07:55
Here's how jetty:run fails if the native lib packaging is changed to dylib.
From 0fb3e83164a5228d4c98194ae225f4568292ed2c Mon Sep 17 00:00:00 2001
From: Ilkka Laukkanen <ilkka.s.laukkanen@gmail.com>
Date: Tue, 19 Nov 2013 09:53:41 +0200
Subject: [PATCH] Change references to .so libs to .dylib
---
native-jar/pom.xml | 8 ++++----
native/pom.xml | 2 +-
pom.xml | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
@ilkka
ilkka / jahspotify-web-jetty-run-1384847175.log
Created November 19, 2013 07:48
Result of first running 'mvn -P MacOSX clean install' in the project root, then running 'mvn -P MacOSX jetty:run' in the 'web' dir
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for jahspotify:jahspotify-web:war:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing. @ line 46, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
@ilkka
ilkka / gist:6388908
Created August 30, 2013 11:23
Strange timezone printing behaviour from the Clojure REPL
java -cp ~/Downloads/clojure-1.6.0-master-20130821.123934-9.jar clojure.main
Clojure 1.6.0-master-SNAPSHOT
user=> (java.util.Calendar/getInstance)
#inst "2013-08-30T14:20:22.289+02:00"
user=> (let [fmt "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
fmter (java.text.SimpleDateFormat. fmt)]
(.format fmter (.getTime (java.util.Calendar/getInstance))))
"2013-08-30T14:22:20.755+0300"
user=>