I hereby claim:
- I am petermd on github.
- I am petermd (https://keybase.io/petermd) on keybase.
- I have a public key whose fingerprint is 496A 7E97 F6D9 C7CA DCA9 E4CB E581 5637 A8F1 85CF
To claim this, I am signing this object:
public static | |
InetSocketAddress getRemoteAddress (final ServerWebSocket ws) | |
throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException | |
{ | |
InetSocketAddress addr = null; | |
final WebSocketImplBase requestWS = (WebSocketImplBase)ws; | |
Field f = WebSocketImplBase.class.getDeclaredField("conn"); //NoSuchFieldException | |
f.setAccessible(true); | |
ConnectionBase connectionBase = (ConnectionBase) f.get(requestWS); //IllegalAccessException |
$(document).ready(function () { | |
//var end = new Date.getHours(); | |
var currentMonth = (new Date).getMonth() + 1; | |
var currentDay = (new Date).getDate(); // create an instance of the date object | |
var datetoday = new Date(); // create new Date() | |
var timenow = datetoday.getTime(); // grabbing the time it is now | |
datetoday.setTime(timenow); // setting the time now to datetoday variable | |
var hournow = datetoday.getHours(); //the hour it is | |
var month = $('.CurrentMonth'); |
(defn sum-digits [num] | |
(+ (quot num 10) (mod num 10))) | |
(defn sum-doubleeven [idx num] | |
(sum-digits (if (even? idx) num (* num 2)))) | |
(defn luhn? [num] | |
(zero? (mod (reduce + (map-indexed sum-doubleeven (reverse num))) 10))) | |
(defn test-luhn [] |
I hereby claim:
To claim this, I am signing this object:
import java.security.MessageDigest | |
def md5(String s) { | |
MessageDigest digest = MessageDigest.getInstance("MD5") | |
digest.update(s.bytes); | |
new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0') | |
} | |
def check(p) { | |
try { |
#!/usr/bin/env python | |
# | |
# post-commit hook for svn to notify pivotaltracker | |
# | |
# Posts commit to pivotal to enable auto-tracking of commits. Adds viewvc link if url provided. Place in SVN/hooks/post-commit as follows | |
# | |
# pivotal_notify.py -v "http://SVNSERVER/BIN/viewvc.cgi" "$REPOS" "$REV" "$PIVOTAL_API_TOKEN" | |
# | |
from xml.sax.saxutils import escape |
#!/bin/bash | |
PASS_OPS=${KC_MOCK_PASS:-none} | |
FAIL_OPS=${KC_MOCK_FAIL:-none} | |
if [[ $FAIL_OPS == *"$1"* ]]; then | |
>&2 echo "$0: mock-fail" "$@" | |
exit 1 | |
elif [[ $PASS_OPS == *"$1"* ]]; then | |
>&2 echo "$0: mock-pass" "$@" |
var collectionNames = db.getCollectionNames(), stats = []; | |
collectionNames.forEach(function (n) { stats.push(db[n].stats()); }); | |
stats = stats.sort(function(a, b) { return b['size'] - a['size']; }); | |
for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize']/(1024*1024) + ")"); } | |