Skip to content

Instantly share code, notes, and snippets.

Jason Sperske jasonsperske

Block or report user

Report or block jasonsperske

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jasonsperske
jasonsperske / Wave_Writer.cpp
Last active Aug 29, 2015
Small utility that generates a clean set of WAV files from any supported format of game-music-emu
View Wave_Writer.cpp
// Game_Music_Emu 0.6.0. http://www.slack.net/~ant/
#include "Wave_Writer.h"
#include <assert.h>
#include <stdlib.h>
/* Copyright (C) 2003-2006 by Shay Green. Permission is hereby granted, free
of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without
@jasonsperske
jasonsperske / highlight.html
Created May 15, 2014
Basic System to highlight keywords in a textarea (http://jsfiddle.net/KcP7m/)
View highlight.html
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>Textarea Highlighter</title>
<script src="//code.jquery.com/jquery-1.11.0.js" type="text/javascript"></script>
<style type="text/css">
#Status, #Highlighter {
width: 96%;
height: 250px;
font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif;
@jasonsperske
jasonsperske / car_cdr.playground
Last active Aug 29, 2015
Getting aquainted with a new langauge. Really wish there was a splatter operator.
View car_cdr.playground
func car<T>(l: Array<T>?) -> T? {
if l == nil || l!.count <= 0 {
return nil
} else {
return l![0]
}
}
func cdr<T>(l: Array<T>?) -> Array<T>? {
if l == nil || l!.count <= 1 {
@jasonsperske
jasonsperske / so.scheme
Created Aug 19, 2014
Nested for loops in scheme
View so.scheme
(define (SO x y)
(let* ((x! (car x)) (y! (car y)))
(while (< x! (car (cdr x)))
(set! y! (car y))
(while (< y! (car (cdr y)))
(print (string-append (number->string x!) "-" (number->string y!)))
(set! y! (+ y! 1))
)
(set! x! (+ x! 1))
)
View keybase.md

Keybase proof

I hereby claim:

  • I am jasonsperske on github.
  • I am sperske (https://keybase.io/sperske) on keybase.
  • I have a public key whose fingerprint is E40C A8A8 8284 94A9 823C 951D 7865 73E7 33D8 50FA

To claim this, I am signing this object:

View github.js
var page = require('webpage').create();
page.open('http://github.com/', function() {
page.render('github.png');
phantom.exit();
});
@jasonsperske
jasonsperske / CompressionFilter.java
Last active Aug 29, 2015
A flexible compression filter for Tomcat web apps created by http://stackoverflow.com/a/11068672/16959
View CompressionFilter.java
public class CompressionFilter implements Filter {
public void destroy() {}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response;
String acceptEncoding = httpRequest.getHeader(HttpHeaders.ACCEPT_ENCODING);
if (acceptEncoding != null) {
if (acceptEncoding.indexOf("gzip") >= 0) {
GZIPHttpServletResponseWrapper gzipResponse = new GZIPHttpServletResponseWrapper(httpResponse);
@jasonsperske
jasonsperske / wizard.html
Created Apr 24, 2015
A Bootstrap styled wizard
View wizard.html
<!-- example from http://getfuelux.com/javascript.html#wizard -->
<link href="//www.fuelcdn.com/fuelux/3.6.3/css/fuelux.min.css" rel="stylesheet">
<script src="//www.fuelcdn.com/fuelux/3.6.3/js/fuelux.min.js"></script>
<div class="wizard" data-initialize="wizard" id="myWizard">
<ul class="steps">
<li data-step="1" data-name="campaign" class="active"><span class="badge">1</span>Campaign<span class="chevron"></span></li>
<li data-step="2"><span class="badge">2</span>Recipients<span class="chevron"></span></li>
<li data-step="3" data-name="template"><span class="badge">3</span>Template<span class="chevron"></span></li>
</ul>
<div class="actions">
View gist:e6924e5db1807ccb9319
From http://sndtst.com/Doom
You will find these meta tags:
<meta property='sndtst:title' content='Doom'/>
<meta property='sndtst:platform' content='PC'/>
<meta property='sndtst:composed_by' content='Bobby Prince' role='Composer/Arranger'/>
View my.css
background: linear-gradient(223deg, #00ffbd, #7d00ff, #ef583a);
background-size: 600% 600%;
-webkit-animation: Channel 42s ease infinite;
-moz-animation: Channel 42s ease infinite;
-o-animation: Channel 42s ease infinite;
animation: Channel 42s ease infinite;
@-webkit-keyframes Channel {
    0%{background-position:81% 0%}
    50%{background-position:20% 100%}
    100%{background-position:81% 0%}
You can’t perform that action at this time.