Skip to content

Instantly share code, notes, and snippets.

View joelso's full-sized avatar

Joel Söderström joelso

View GitHub Profile
@joelso
joelso / order-schema.json
Created April 15, 2019 13:42
schema-test
{
"additionalProperties": false,
"description": "Get order by id response",
"id": "GetOrderByIdResponse",
"properties": {
"address": {
"additionalProperties": false,
"properties": {
"city": {
"description": "city",
@joelso
joelso / android-rhino.md
Last active August 29, 2015 14:21
Creating an JS object and invoking a method, using Rhino

JSEngine.java

// ...

public Object run(String script) {
   return rhinoContext.evaluateString(sharedJsScope, script, "A label here", 1, null);
}

public Object invokeFn(Scriptable o, String fn, Object... args) {

@joelso
joelso / JenkinsCocoapods.sh
Last active December 17, 2015 05:08
Jenkins build script for iOS app using Cocoapods
#!/usr/bin/env bash
source ~/.bash_profile
BUILD_DIR=$(PWD)/build
APP_NAME="FooApp"
CODE_SIGN_IDENTITY="iPhone Distribution: Foo & Bar"
PROVISIONING_PROFILE_ID="7637D74D-F0A0-42EC-8466-0F81978AFFEE"
PROVISIONING_PROFILE="/Users/Shared/Jenkins/Library/MobileDevice/Provisioning Profiles/${PROVISIONING_PROFILE_ID}.mobileprovision"
KEYCHAIN_PASSWORD="verysecret"
@joelso
joelso / Build.scala
Created August 28, 2012 10:11
Enable bytecode enhancement of test dir in Play Framework 2.0.x
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "foo"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
@joelso
joelso / WithSessionTest.java
Created August 26, 2012 21:42
withSession issue
import org.junit.Test;
import play.test.FakeRequest;
import static org.junit.Assert.assertEquals;
import static play.test.Helpers.fakeApplication;
import static play.test.Helpers.running;
public class WithSessionTest {
@Test
@joelso
joelso / MockData.java
Last active October 9, 2015 09:27
Simple test util for producing mock data
package util;
import java.util.*;
public class MockData {
private static Random rand = new Random();
private static final List<String> firstNames = Arrays.asList("Kevin", "Dave", "David", "Alan", "Derek", "Paul", "Nick", "Mark", "Sam", "Dan", "Robert", "Gavin", "Terry", "Barry", "Rahul", "Steve", "John", "Naeem", "Harris", "Natalie","Sarah","Deidre","Gladys","Penny","Rebecca","Grace","Kelly","Sally","Maggie","Kate","Kathryn");
@joelso
joelso / usePlay.sh
Created August 3, 2012 12:15 — forked from bverbeken/usePlay.sh
script to easily switch between Playframework versions
#!/bin/bash
BASE_PATH="$HOME/playframework"
changeVersion () {
ln -nsf $1 $BASE_PATH/play;
}
usage() {
@joelso
joelso / demo.html
Created December 11, 2011 14:48
jquery plugin wrapper of Valums fileuploader
<!DOCTYPE html>
<html>
<head>
<style type="text/css" media="screen">
section { padding-top:20px; }
</style>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="https://raw.github.com/valums/file-uploader/master/client/fileuploader.js" type="text/javascript" charset="utf-8"></script>
export MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n"
mvn clean -Djava.net.preferIPv4Stack=true jetty:run -Pdev,hsqldb,db-create,sv