Skip to content

Instantly share code, notes, and snippets.

View leon's full-sized avatar

Leon Radley leon

View GitHub Profile
@leon
leon / README.md
Created September 25, 2014 09:35
Convert all files to utf-8

Use with causion

Sometimes the script fails to convert and spits out an empty file instead.

@leon
leon / Dockerfile
Created November 16, 2014 15:07
docker java 8
#
# - install jdk8 from oracle
#
RUN apt-get install -y python-software-properties software-properties-common
RUN add-apt-repository ppa:webupd8team/java
RUN apt-get update
RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
RUN apt-get install -y oracle-java8-installer
@leon
leon / MyApplication.java
Last active August 29, 2015 14:18
Gradle config for spring data fowler and java 8 dates
package test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.orm.jpa.EntityScan;
import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters;
@SpringBootApplication
// Enable java 8 dates in hibernate
@EntityScan(basePackageClasses = { MyApplication.class, Jsr310JpaConverters.class })
package se.radley.security;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.cloud.security.oauth2.sso.OAuth2SsoProperties;
import org.springframework.security.authentication.AuthenticationDetailsSource;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
@leon
leon / relate-2.0-swedish-lang.xml
Created June 21, 2011 07:30
Relate+ 2.0 Swedish translation
<?xml version="1.0" encoding="utf-8"?>
<languages>
<language name="Swedish" id="sv">
<pagetitles>
<images>bilder</images>
<imagegalleries>bildgallerier</imagegalleries>
<myblog>blogg</myblog>
<myfriends>vänner</myfriends>
<mypage>min sida</mypage>
</pagetitles>
@leon
leon / README.md
Created February 4, 2014 09:49
angularjs $q decorator for spread

Use it like this

$q.all([ promise1, promise2 ]).then($q.spread(function (promise1Result, promise2Result) {

});

@leon
leon / Property.cs
Created August 22, 2011 11:39
EPiServer Property usercontrol
using EPiServer.Core;
using EPiServer.Security;
using EPiServer.Web.PageExtensions;
using EPiServer.Web.PropertyControls;
using log4net;
using System;
using System.ComponentModel;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace EPiServer.Web.WebControls
@leon
leon / playframework
Created October 15, 2011 19:14 — forked from domdorn/playframework
Upstart Script for the PlayFramework 1.x
# Upstart script for a play application that binds to an unprivileged user.
# put this into a file like /etc/init/playframework
# you can then start/stop it using either initctl or start/stop/restart
# e.g.
# start playframework
# http://dominikdorn.com
description "Description of your app"
author "Dominik Dorn <dominik@studyguru.eu>"
version "1.0"
@leon
leon / tomcat-on-ubuntu.md
Created November 30, 2011 14:36
Tomcat 7

Update

apt-get update

Install java

apt-get install sun-java6-jdk

Make sure java is available to ./configure otherwise it wont build

echo JAVA_HOME="/usr/lib/jvm/java-6-sun" >> /etc/environment
echo JRE_HOME="/usr/lib/jvm/java-6-sun/jre" >> /etc/environment
@leon
leon / rmate
Created December 15, 2011 07:42
Setup TextMate's ssh rmate function
#!/usr/bin/env ruby
# encoding: UTF-8
$VERBOSE = true # -w
$KCODE = "U" if RUBY_VERSION < "1.9" # -KU
require 'optparse'
require 'socket'
require 'fileutils'