Skip to content

Instantly share code, notes, and snippets.

View bclozel's full-sized avatar

Brian Clozel bclozel

View GitHub Profile
<html>
<head></head>
<body>
<script>
/* commented the whole thing
var el1 = document.createElement('iframe');
var el2 = document.createElement('iframe');
el1.style.visibility="hidden";
el2.style.visibility="hidden";
el1.src = "http://twitter.com/share/update?status=WTF:%20" + window.location;
@bclozel
bclozel / resthub-2-0.md
Created October 31, 2012 16:54
RESThub 2.0 released

RESThub 2.0 released

We are pleased to announce the second major release of the RESThub framework!

(Insert picture here)

RESThub is a framework stack based on Spring and Backbone.js, designed to build HTML5 applications easily and efficiently. RESThub focuses on modular web applications, made of stateless REST/Websockets web services and client-side state managed by MVVM JavaScript clients.

@bclozel
bclozel / websocket-config-broker-customchannels.xml
Last active August 29, 2019 00:58
xml configuration for websocket / sockjs SPR-11063
<!--
~ Copyright 2002-2013 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
@bclozel
bclozel / UriTemplateCollectionExamples.java
Created December 23, 2013 12:30
Comparing what RFC6570 based and "simple" URI template implementations can do.
/*
* RFC6570
*/
Map<String, Object> values = new HashMap<String, Object>();
values.put("count", Arrays.asList("one","two","three"));
UriComponentsBuilder.fromPath("{/count*}")
.buildAndExpand(values).encode().toUriString(); // "/one/two/three"
@bclozel
bclozel / mvc-config-content-negotiation-manager-v1.xml
Last active January 3, 2016 14:39
SPR-10163 - Configuring RequestMappingHandlerMapping via XML
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<mvc:annotation-driven content-negotiation-manager="contentNegotiationManager"
use-registered-suffix-pattern-match="true"/>
@bclozel
bclozel / MultipleResolverResourcesConfig.java
Last active September 24, 2022 13:36
Resource Handling configuration drafts
@Configuration
public class MultipleResolverResourcesConfig extends WebMvcConfigurerAdapter {
// Multiple ResourceResolver configuration
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
List<ResourceResolver> jsResolvers = new ArrayList<>();
jsResolvers.add(new PrefixResourceResolver("hexprefix"));
jsResolvers.add(new PathResourceResolver());
<!doctype html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Spring resource handling</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- resource with a MD5 fingerprint in its filename -->
<link rel="stylesheet" type="text/css" href="/css/main-503adc9d6fd0379fe63021d9ff456ac6.css">
@bclozel
bclozel / WebConfigDartCss.java
Last active August 29, 2015 14:04
SPR-11982 - Enhance ResourceHandlerRegistration API for resource transformers/resolvers
/**
* Dart + CSS webapp
* We could do the same for coffeeScript, TypeScript, etc
* just change the file extension accordingly in the version strategies.
*/
if (this.env.acceptsProfiles("development")) {
registry.addResourceHandler("/**")
.addResourceLocations("file:///" + getProjectRootRequired() + "/client/src/")
.addContentVersionStrategy("/**")
// SIMPLE
boolean cacheResources = true;
registry.addResourceHandler("/resources/**")
.addResourceLocations("classpath:META-INF/static")
.setCachePeriod(3600)
.resourceChain(cacheResources)
.add(new VersionResolver().addContentVersionStrategy("/**").addFixedVersionStrategy("abc", "/**/*.js"))
.add(new AppCacheManifestTransformer());
@bclozel
bclozel / keybase.md
Created October 10, 2014 07:31
keybase verification

Keybase proof

I hereby claim:

  • I am bclozel on github.
  • I am bclozel (https://keybase.io/bclozel) on keybase.
  • I have a public key whose fingerprint is 3CDA 667B 27A6 35C4 8E4D D88D 903B 8F25 6817 9933

To claim this, I am signing this object: