Skip to content

Instantly share code, notes, and snippets.

@seanadkinson
seanadkinson / example-route.js
Last active July 10, 2017 03:49
Merging react-router with react-proxy-loader to load bundles on page change
<Router.Route path="/home" handler={require('react-router-proxy!./Home.jsx')}/>
@seanadkinson
seanadkinson / herokuRelease.js
Last active August 29, 2015 14:13
Heroku Current Version Number in Node.js
var _ = require('lodash'),
Heroku = require('heroku-client'),
heroku = new Heroku({ token: process.env.HEROKU_API_KEY });
var app = heroku.apps('application-name');
app.releases().list(function(err, releases) {
var version = _.max(_.pluck(releases, 'version'));
console.log("APP_VERSION: " + version);
process.env.APP_VERSION = version;
@seanadkinson
seanadkinson / HistoryJSLocation.js
Last active August 29, 2015 14:11
React-Router History.js Location
"use strict";
/**
* Location provider for react-router that uses History.js to
* provide HTML5 History API-like functionality for older browsers
* such as IE 7-9.
*
* This file:
* - Uses webpack and the script-loader to include History.js
* - Assumes you have historyjs installed in node_modules
<Router.Routes location="history">
<Router.Route path="/" handler={Application}>
<Router.Route path="/dashboard" handler={Dashboard}/>
<Router.Route path="/sessions" handler={Sessions}/>
<Router.Route path="/awards" handler={MyAwards}/>
</Router.Route>
<Router.Route path="*" handler={NotFound}/>
</Router.Routes>
java.lang.NullPointerException
com.jamasoftware.contour.security.TenantAwareContourSessionRegistry.getSessionInformation(TenantAwareContourSessionRegistry.java:143)
com.jamasoftware.contour.view.filter.ContourConcurrentSessionFilter.doFilter(ContourConcurrentSessionFilter.java:28)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
com.jamasoftware.contour.view.filter.TenantFilter.doFilter(TenantFilter.java:85)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
com.jamasoftware.contour.view.filter.GzipFilter.doFilter(GzipFilter.java:47)
java.lang.NullPointerException
com.jamasoftware.contour.security.TenantAwareContourSessionRegistry.getSessionInformation(TenantAwareContourSessionRegistry.java:143)
com.jamasoftware.contour.view.filter.ContourConcurrentSessionFilter.doFilter(ContourConcurrentSessionFilter.java:28)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
com.jamasoftware.contour.view.filter.TenantFilter.doFilter(TenantFilter.java:85)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
com.jamasoftware.contour.view.filter.GzipFilter.doFilter(GzipFilter.java:47)
@seanadkinson
seanadkinson / Disassembled StaticFinal2Gate
Last active August 29, 2015 14:00
Compiling static finals
☕ javap -c Gate\$StaticFinal2Gate.class
Compiled from "Gate.java"
public class Gate$StaticFinal2Gate {
public Gate$StaticFinal2Gate();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: aload_0
5: iconst_0
6: putfield #2 // Field flag:Z
@seanadkinson
seanadkinson / gist:5390211
Created April 15, 2013 18:27
A comment with #decision
<span class="js-root-comment-text-wrapper"><p></p><p style="margin: 0px; padding: 0px; min-height: 20px; color: rgb(0, 0, 0); font-family: Arial, Helvetica, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">#smoketestingnotes:&nbsp;</p>
<p style="margin: 0px; padding: 0px; min-height: 20px; color: rgb(0, 0, 0); font-family: Arial, Helvetica, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">&nbsp;</p>
<p style="margin: 0px; padding: 0px; min-height: 20px; color:
@seanadkinson
seanadkinson / _icons.scss
Last active December 14, 2015 16:09
"blue-doc-hover.css" is the generated CSS with naming the icon with a dash. "blue-doc_hover.css" is with an underscore". Both obviously contain "blue-doc.png". What's weird is that the dash case doesn't produce a "blue-doc-hover" class, which seems to me that it is recognizing something special about the naming.
$icons-spacing: 10px;
@import "icons/*.png";
@include all-icons-sprites;
@seanadkinson
seanadkinson / coffee_buildr
Created September 12, 2012 03:46
History.js buildr error
SeansMac:history.js seanadkinson$ ls
History.md buildr.coffee license.txt scripts tests.src
README.md demo package.json tests vendor
SeansMac:history.js seanadkinson$ npm install
npm WARN history.js@1.7.1-r2 package.json: bugs['web'] should probably be bugs['url']
npm http GET https://registry.npmjs.org/buildr
npm http 200 https://registry.npmjs.org/buildr
npm WARN buildr@0.8.2 package.json: bugs['web'] should probably be bugs['url']
npm http GET https://registry.npmjs.org/less-bal
npm http GET https://registry.npmjs.org/jshint