Skip to content

Instantly share code, notes, and snippets.

View jeremylong's full-sized avatar

Jeremy Long jeremylong

View GitHub Profile
CREATE TYPE [dbo].[PrimaryKeyINT] AS TABLE(
[id] [int]
)
GO
CREATE PROCEDURE [dbo].[usp_GetDetails]
(
@inClause PrimaryKeyINT READONLY
)
@jeremylong
jeremylong / bind_table_type.cs
Created June 11, 2013 00:13
Binding a user defined table type for use within an IN clause.
DataTable dt = new DataTable();
dt.Columns.Add("id", typeof(int));
var row = dt.NewRow();
row["id"] = 1;
dt.Rows.Add(row);
row = dt.NewRow();
row["id"] = 2;
dt.Rows.Add(row);
SqlConnection conn = new SqlConnection("Data Source=localhost;Integrated Security=SSPI;Initial Catalog=test");
conn.Open();
@jeremylong
jeremylong / pom.xml
Last active February 26, 2016 21:55
dependency-check-maven-mysql
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven-mysql</artifactId>
<version>1.3.1</version>
<packaging>maven-plugin</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
### Keybase proof
I hereby claim:
* I am jeremylong on github.
* I am ctxt (https://keybase.io/ctxt) on keybase.
* I have a public key ASAql61mIWSSolrhG_4ZfciMvbefNKfoq71kw-d43wbw6Qo
To claim this, I am signing this object:
var existing = document.getElementsByTagName("script")[0];
var nonce = existing.getAttribute("nonce");
var newScript = document.createElement("script");
var att = document.createAttribute("nonce");
att.value = nonce;
newScript.setAttributeNode(att);
@jeremylong
jeremylong / odc-maven-tree.py
Created November 30, 2021 13:36
Poorly written code that maps the mvn dependency:tree output to the vulnerability information from ODC.
## mvn dependency:tree -DoutputFile=./target/tree.txt
## mvn org.owasp:dependency-check-maven:6.5.0:check -Dformats=HTML,JSON
## python3 odc-maven-tree.py ./target/tree.txt ./target/dependency-check-report.json > ./target/odc_tree.html
import json
import sys
import re
if len(sys.argv) != 3:
sys.exit("Missing path to dependency:tree report and/or the odc json report")