A cash register has a drawer with separate bins for eight different denominations of money:
- Pennies
- Nickels
- Dimes
- Quarters
- Singles
- Fives
#!/bin/sh | |
sort -n | awk ' | |
BEGIN { | |
c = 0; | |
sum = 0; | |
} | |
$1 ~ /^[0-9]*(\.[0-9]*)?$/ { | |
a[c++] = $1; | |
sum += $1; | |
} |
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 |
// ==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 */ |
#!/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 |
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 { |
var handleSuccess = (function () { | |
var latestRequestTimestamp = 0; | |
return function handleSuccess(timestamp, data) { | |
if (timestamp < latestRequestTimestamp) { return; } | |
latestRequestTimestamp = timestamp; | |
/ stuff | |
}; | |
}); |
// Also: https://maven.apache.org/plugin-developers/cookbook/add-svn-revision-to-manifest.html | |
// pom.xml pieces | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>versions-maven-plugin</artifactId> | |
<version>${versions-maven-plugin.version}</version> | |
</plugin> | |
<plugin> |
keytool -importkeystore -srckeystore "source-keystore.jks" -destkeystore "destination-keystore.jks" -srcstorepass password -deststorepass password -srcalias "alias" |
-- Personal preference for unpivot | |
SELECT | |
SUBSTR(CLMN, 0, INSTR(CLMN,'_TOTAL_FROM', 1, 1)-1) AS COLOR, COUNT, COUNT/TOTAL*100 || '%' AS PCT, TOTAL, FROM_DATE, TO_DATE | |
FROM ( | |
WITH SUMMARY AS | |
(SELECT | |
TO_DATE('2015-09-28','YYYY-MM-DD') AS FROM_DATE, TO_DATE('2015-10-01','YYYY-MM-DD') AS TO_DATE, 100000 AS TOTAL, 90000 AS BLUE, | |
5000 AS RED,3000 AS GREEN,0 AS YELLOW | |
FROM DUAL) | |
SELECT * FROM SUMMARY |