Skip to content

Instantly share code, notes, and snippets.

@seanadkinson
seanadkinson / example-route.js
Last active Jul 10, 2017
Merging react-router with react-proxy-loader to load bundles on page change
View example-route.js
<Router.Route path="/home" handler={require('react-router-proxy!./Home.jsx')}/>
@seanadkinson
seanadkinson / herokuRelease.js
Last active Aug 29, 2015
Heroku Current Version Number in Node.js
View herokuRelease.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 Aug 29, 2015
React-Router History.js Location
View HistoryJSLocation.js
"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
View gist:bcc3e0b6d86b439b9bc1
<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>
View gist:9e78064f2753b16c55fc
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)
View gist:9a01e04b500e70b6bbc4
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)
View Disassembled StaticFinal2Gate
☕ 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 Apr 15, 2013
A comment with #decision
View gist:5390211
<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 Dec 14, 2015
"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.
View _icons.scss
$icons-spacing: 10px;
@import "icons/*.png";
@include all-icons-sprites;
@seanadkinson
seanadkinson / coffee_buildr
Created Sep 12, 2012
History.js buildr error
View coffee_buildr
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