Skip to content

Instantly share code, notes, and snippets.

terrancesnyder / CustomJwtTokenStore
Created May 30, 2017 — forked from maxsap/CustomJwtTokenStore
Spring Security OAuth2 programmatic configuration.
View CustomJwtTokenStore
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.apache.commons.lang3.SerializationUtils;
import org.springframework.beans.factory.annotation.Autowired;
terrancesnyder / squid.conf
Created Mar 12, 2016 — forked from hpcorona/squid.conf
simple squid3 configuration to allow all to connect to all
View squid.conf
#Recommended minimum configuration:
acl manager proto cache_object
acl localhost src
acl to_localhost dst
acl localnet src
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
// Encrypt where jo is input, and query is output and ENCRPYTION_KEy is key
byte[] input = jo.toString().getBytes("utf-8");
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] thedigest = md.digest(ENCRYPTION_KEY.getBytes("UTF-8"));
SecretKeySpec skc = new SecretKeySpec(thedigest, "AES/ECB/PKCS5Padding");
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, skc);
byte[] cipherText = new byte[cipher.getOutputSize(input.length)];
View vows-phantom.js
var phantom = require('phantom'),
vows = require('vows'),
assert = require('assert');
// nesting tests inside phantom callback so we only
// have to create it once
phantom.create(function(ph) {
var get_page_result = function(url, fn, result) {
ph.createPage(function(page) {
terrancesnyder / index.html
Created Sep 13, 2012 — forked from ovaillancourt/index.html
Socket io + static file serving with connect
View index.html
<!-- This should be served by your server -->
<script src="/"></script>
var socket = io.connect('http://localhost');
socket.on('news', function (data) {
socket.emit('my other event', { my: 'data' });