Skip to content

Instantly share code, notes, and snippets.

@jalex19100
jalex19100 / auto_dealer_simplify.user.js
Last active December 2, 2016 17:48
auto_dealer_simplify.user.js
// ==UserScript==
// @name Auto Dealer Simplification
// @namespace jalex.net
// @include *://*.com/used-inventory/*
// @version 1
// @grant none
// ==/UserScript==
setTimeout(function () {
$("#salemove > div").remove();
$("body > div.ddc-header.sticky-header-nav.shrink-header-nav").remove();

Keybase proof

I hereby claim:

  • I am jalex19100 on github.
  • I am jalex19100 (https://keybase.io/jalex19100) on keybase.
  • I have a public key whose fingerprint is E4E5 28FA A297 330F 0F66 4048 372C 3BE5 261F AC9D

To claim this, I am signing this object:

/*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*

Cash Register Problem

A cash register has a drawer with separate bins for eight different denominations of money:

  • Pennies
  • Nickels
  • Dimes
  • Quarters
  • Singles
  • Fives
@jalex19100
jalex19100 / singleColumnDataStats.sh
Last active April 27, 2016 21:54
The above script reads from stdin, and prints tab-separated columns of output on a single line. See: http://unix.stackexchange.com/questions/13731/is-there-a-way-to-get-the-min-max-median-and-average-of-a-list-of-numbers-in
#!/bin/sh
sort -n | awk '
BEGIN {
c = 0;
sum = 0;
}
$1 ~ /^[0-9]*(\.[0-9]*)?$/ {
a[c++] = $1;
sum += $1;
}
@jalex19100
jalex19100 / SimpleLocalhostSSL.sh
Last active April 26, 2016 19:11
OpenSSL SSL cert creation for localhost intranet development
openssl genrsa -out server.key -passout pass:test 1024
openssl req -new -subj "/CN=localhost" -key server.key -out server.csr
openssl x509 -req -days 36500 -in server.csr -signkey server.key -out server.crt
## Lines needed in the Apache configuration to enable SSL (probably in a <VirtualHost *:443> tag):
# SSLEngine on
# SSLProtocol all -SSLv2
# SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5:!SEED:!IDEA
# SSLCertificateFile /keylocation/server.crt
@jalex19100
jalex19100 / twitter_cleanup.user.js
Last active March 11, 2016 18:49
Twitter cleanup
// ==UserScript==
// @name Remove Twitter Inline Images
// @namespace fixTheTwittersNet
// @version 0.2
// @include /^https?://www\.twitter\.com/.*$/
// @include /^https?://twitter\.com/.*$/
// @author This dude
// @description This script removes inline images until you click the expand button
// ==/UserScript==
/* jshint -W097 */
@jalex19100
jalex19100 / create_azure_pfx.sh
Created December 21, 2015 17:38
Create Azure-compatible cert with openssl (mac/linux)
#!/bin/bash
#
# REF: https://azure.microsoft.com/en-us/documentation/articles/web-sites-configure-ssl-certificate/#bkmk_selfsigned
#
###### serverauth.cnf #####
#[ req ]
#default_bits = 2048
#default_keyfile = privkey.pem
#distinguished_name = req_distinguished_name
#attributes = req_attributes
@jalex19100
jalex19100 / StringPerformance.java
Created December 4, 2015 19:07
Really old class to test String performance in Java. Wasn't that helpful.
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
/**
* Class: StringPerformance
*/
public class StringPerformance {
@jalex19100
jalex19100 / grabThatFinalXHR.js
Created November 25, 2015 20:50
Grab only the most recently requested ajax call to avoid the response getting overwritten by older calls
var handleSuccess = (function () {
var latestRequestTimestamp = 0;
return function handleSuccess(timestamp, data) {
if (timestamp < latestRequestTimestamp) { return; }
latestRequestTimestamp = timestamp;
/ stuff
};
});