Skip to content

Instantly share code, notes, and snippets.

View JonCooperWorks's full-sized avatar

JonCooperWorks

View GitHub Profile
# This will run a collection in Newman using the environment we specify
newman -e path/to/environment.json run path/to/collection.json
@JonCooperWorks
JonCooperWorks / aes.go
Created April 11, 2016 04:18
Cryptography engineering in golang
package main
import (
"crypto/aes"
"crypto/cipher"
"fmt"
"encoding/hex"
)
type ecb struct {
@JonCooperWorks
JonCooperWorks / DisqusWebViewClient.java
Created April 29, 2015 09:49
Custom WebViewClient for Disqus comments on android
package your.app.package;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.Nullable;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import java.util.HashSet;
{
"info": {
"name": "Gruyere Collection",
"_postman_id": "9efdd931-ac99-5996-8bcd-07c07652dcfa",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Login Request",
{
"id": "e39f0a28-d5ef-461f-807b-35e9078e210b",
"name": "Postman Blog Post",
"values": [
{
"enabled": true,
"key": "username",
"value": "test",
"type": "text"
},
{
"info": {
"name": "Alphavantage",
"_postman_id": "5866f354-6cbe-1abb-918c-d56c5d15810c",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Alphavantage Collection",
Loaded plugins: fastestmirror
Installed Packages
GeoIP.x86_64 1.5.0-11.el7 installed
PyYAML.x86_64 3.10-11.el7 installed
acl.x86_64 2.2.51-12.el7 installed
apr.x86_64 1.4.8-3.el7_4.1 @updates
apr-util.x86_64 1.5.2-6.el7 @base
audit.x86_64 2.7.6-3.el7 installed
audit-libs.x86_64 2.7.6-3.el7 installed
audit-libs-python.x86_64 2.7.6-3.el7 installed
@JonCooperWorks
JonCooperWorks / CoR.scala
Created March 24, 2013 02:49
A simple scala program demonstrating the Chain of Responsibility design pattern
case class Event(level: Int, title: String)
//Base handler class
abstract class Handler {
val successor: Option[Handler]
def handleEvent(event: Event): Unit
}
//Customer service agent
class Agent(val successor: Option[Handler]) extends Handler {
package main
import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"io/ioutil"
"log"
"github.com/joncooperworks/signedplugin"
key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
if err != nil {
log.Fatalln(err.Error())
}
incorrectKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
if err != nil {
log.Fatalln(err.Error())
}