This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'securerandom' | |
puts SecureRandom.uuid | |
# OR | |
# direct from command line: jruby -e "require 'securerandom' ; puts SecureRandom.uuid" | |
# IRB | |
# irb(main):001:0> require 'securerandom' | |
# true | |
# irb(main):002:0> SecureRandom.uuid | |
# "8af55604-db60-4347-bb0a-1e13ac058685" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- first SELECT has values you want to insert. | |
-- second SELECT has enough of those values to verify if record already exists (e.g. primary key) | |
insert into some_table(col1, col2) | |
select "value 1", "value 2" from dual where not exists | |
(select 1 from some_table where col1 = "value 1" and col2 = "value3") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://docs.mongodb.org/manual/reference/operator/aggregation/ | |
db.agencyProfiles.aggregate( [ | |
{ $match: {"_id":"Florida SUI Wage"} }, | |
{ $unwind: "$agencyErrors" }, | |
{ $project: {_id:0, agencyErrors: {errorDescription:1, cannedAction:{actionCodeDescription:1}}}} | |
] ) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Gradle dep's | |
// compile 'org.apache.poi:poi:3.12' | |
//compile 'com.opencsv:opencsv:3.5' | |
//compile 'log4j:log4j:1.2.14' | |
package util; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.StringReader; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add a new configuration | |
configurations { | |
fortify { extendsFrom compile } | |
} | |
// pull in the fortify libs for the new configuration | |
dependencies { | |
fortify 'com.fortify:sourceanalyzer:3.90' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.XXXXXXXX.filetransfer; | |
import java.io.BufferedInputStream; | |
import java.io.BufferedOutputStream; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import org.springframework.core.io.FileSystemResource; | |
import org.springframework.core.io.Resource; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prints out a multiplication chart | |
# whipped this to show my 8 year old daughter how cool programming is... | |
# 1 2 3 4 5 6 7 8 9 | |
# --------------------------------------------- | |
# 1 | 1 2 3 4 5 6 7 8 9 | |
# 2 | 2 4 6 8 10 12 14 16 18 | |
# 3 | 3 6 9 12 15 18 21 24 27 | |
# 4 | 4 8 12 16 20 24 28 32 36 | |
# 5 | 5 10 15 20 25 30 35 40 45 | |
# 6 | 6 12 18 24 30 36 42 48 54 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby -w | |
require 'digest/md5' | |
ARGV.each do |f| | |
digest = Digest::MD5.file(f) | |
puts "#{f}: #{digest}" | |
end | |
__END__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:template match="@*|node()"> | |
<xsl:copy> | |
<xsl:apply-templates select="@*|node()"/> | |
</xsl:copy> | |
</xsl:template> | |
</xsl:stylesheet> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(args){ | |
def url = args[0] | |
def text = url.toURL().text | |
println text | |
} | |
else { | |
println "USAGE: gget url" | |
} |
NewerOlder