Skip to content

Instantly share code, notes, and snippets.

Avatar

Emerson Farrugia emersonf

View GitHub Profile
View learn-more-about-mental-health.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Learn More About Mental Health</title>
</head>
<body>
<h1>Mental Health</h1>
<h2>What Is Mental Health?</h2>
@emersonf
emersonf / PAM.json
Created Feb 23, 2017
PAM score mapping
View PAM.json
{
"PAM":{
"identifier":"PAMIdentifier",
"prompt":"Select the photo that best captures how you feel right now:",
"summary":{
"identifier":"PAM Summary Identifier",
"title":"Thanks",
"text":"Thank you for participating in PAM"
},
"affects":[
@emersonf
emersonf / output.json
Created Jul 28, 2015
minute-resolution intraday step data output by Fitbit shim
View output.json
{
"effective_time_frame": {
"time_interval": {
"start_date_time": "2014-09-10T00:47:00.000Z",
"duration": {
"value": 1,
"unit": "min"
}
}
},
View Ida's Header Schema Draft.json
"header": {
"id": "123e4567-e89b-12d3-a456-426655440000",
"creation_time": "2013-02-05T07:25:00Z",
"schema": {
"namespace": "omh",
"name": "calories_burned",
"version": "1.1.RC1"
"code-url": //new suggestion -- to pull out all data indexed with a SNOMED code?
},
"acquisition_provenance": {
@emersonf
emersonf / Application.java
Last active Aug 29, 2015
Jackson Joda DateTime serialisation from Spring Boot breaks with DelegatingWebMvcConfiguration
View Application.java
@Configuration
@EnableAutoConfiguration
@ComponentScan("internal.sandbox")
public class Application {
public static void main(String[] args) {
new SpringApplicationBuilder(Application.class).run(args);
}
}
@emersonf
emersonf / Application.java
Created Jun 17, 2014
A controller showing unexpected behaviour when URI template variables have regex restrictions.
View Application.java
package internal.sandbox.configuration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
@emersonf
emersonf / build.script.groovy
Last active Aug 29, 2015
A Gradle build script for a Spring Boot application.
View build.script.groovy
apply plugin: 'java'
apply plugin: 'maven' // used for deploying artifacts to Maven repositories
apply plugin: 'spring-boot'
group = 'internal'
version = '1.0-SNAPSHOT'
description = ""
sourceCompatibility = 1.7
targetCompatibility = 1.7
@emersonf
emersonf / MultiModeTestController.java
Created May 2, 2014
A controller that mixes synchronous and asynchronous requests from a single endpoint.
View MultiModeTestController.java
package tv.nativ.mio.publish.common.controller;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@emersonf
emersonf / s3etag.sh
Last active Mar 9, 2021
A Bash script to compute ETag values for S3 multipart uploads on OS X.
View s3etag.sh
#!/bin/bash
if [ $# -ne 2 ]; then
echo "Usage: $0 file partSizeInMb";
exit 0;
fi
file=$1
if [ ! -f "$file" ]; then
@emersonf
emersonf / gist:4989430
Last active Dec 13, 2015
session access in Gatling
View gist:4989430
import com.excilys.ebi.gatling.core.Predef._
class Foo(val a:Int, val b:Int)
class TestSimulation extends Simulation {
val scn = scenario("testScenario")
.exec(session => session.setAttribute("foo", new Foo(1, 2)))
.exec(session => {
println(session.getAttribute("foo.a"))