Skip to content

Instantly share code, notes, and snippets.

View dangerfield's full-sized avatar

William Dangerfield dangerfield

View GitHub Profile
### Keybase proof
I hereby claim:
* I am dangerfield on github.
* I am dangerfield (https://keybase.io/dangerfield) on keybase.
* I have a public key ASA-OGlaQsxXPSBarNuhmDWfQWzkp1O3cE3QF5giLpPNrgo
To claim this, I am signing this object:
@dangerfield
dangerfield / id_rsa.pub
Created September 5, 2014 10:47
public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC5KKySWGrbFO0pexBMro6aO8oKQgfuWpnHzkZ+yHQM5HH2cnIelpLfdgC8SfjypcYhl654PMrsZiL46cFoQL01HbFAaYvqE8BBnPVlZg1SVYthcPj5oykFU6BfvXgQafsvwNGPcMlEk3foTSsL7F55ghqtC9beQZ0AOba8jy0QgGz0ZYcxvaX72/y7LBH7xZYom0+heTi1Alh/pK3WRlE+oKAEwUCScREK4h00o5u3rWvDWFh0iIILxkUXvonykqb54F1tfWtnfgxG3K2oD+7dbVtAxq3Pchi9eGyfsSwdYHP5Rd/O/4T4DMUA0wRWFbjmuy6YTkMMczNPGqIhRG5z
import com.google.common.collect.ComparisonChain;
import com.google.common.util.concurrent.Uninterruptibles;
import java.util.Comparator;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
@dangerfield
dangerfield / Truncation.php
Created October 18, 2011 14:28
Truncation magic
<?php
/**
* Truncates text to requirements
*
* Class to truncate text to a maximum length, number of words and number of sentences
* This methods of this class are designed to be chained.
* For example, $i = new Truncation('Hello this is text. Another sentence'); $i->sentence(1)->get()
*
* @author William Dangerfield
<html>
<head>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="V.Security.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('form').submit(function() {
var s = $('#trans_id').val() + $('#amount').val() + $('#remotepassword').val(); //here three values get added to one string
$('#digest').val(V.Security.md5(s)); //here the values get passed through an md5 comverter and placed into hidden variable "digest" - see below