Skip to content

Instantly share code, notes, and snippets.

@seanhinkley
seanhinkley / BootApplication.java
Created February 17, 2016 16:49
spring boot + thymeleaf 3
package com.boot;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.SpringApplication;
//make sure spring boot doesn't attempt 2.1 config
@SpringBootApplication(exclude={org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration.class} )
public class AppApplication {
public static void main(String[] args) {
SpringApplication.run(AppSecurityApplication.class, args);
}
}
var active = false;
function changeRefer(details) {
if (!active) return;
for (var i = 0; i < details.requestHeaders.length; ++i) {
if (details.requestHeaders[i].name === 'Referer') {
details.requestHeaders[i].value = 'http://www.google.com/';
break;
}
@efouts
efouts / elevatorSaga.js
Last active June 3, 2022 02:57
Passes All Challenges (some take a number of tries)
{
init: function(elevators, floors) {
elevators.forEach(function(e) {
e.isDestination = function(floorNum) {
return e.destinationQueue.indexOf(floorNum) != -1;
}
e.on("floor_button_pressed", function(floorNum) {
if (!e.isDestination(floorNum))
e.goToFloor(floorNum);
@zaphar
zaphar / date_util.erl
Created May 1, 2009 06:07
set of utility functions that wrap the calendar module and erlangs now() date() and time() functions
-module(date_util).
-compile(export_all).
epoch() ->
now_to_seconds(now())
.
epoch_hires() ->
now_to_seconds_hires(now())
.