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 / 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=>
#!/bin/bash -ex
# Paste this into ssh
# curl -sL https://gist.github.com/ilkka/5508287/download | tar -xzO | /bin/bash -ex
# When forking, you can get the URL from the download button.
#
# For OS X, install XCode and command line tools first.
pushd $HOME