Skip to content

Instantly share code, notes, and snippets.

View drawcode's full-sized avatar
😎
Shipping product

Ryan Christensen drawcode

😎
Shipping product
View GitHub Profile
@drawcode
drawcode / xmldigsigobject.java
Created June 14, 2019 23:31
XMl Digital Signature with References and Custom Objects
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/>
<Reference URI="#object">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue>7/XTsHaBSOnJ/jXD5v0zL6VKYsk=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>
@drawcode
drawcode / RSAPKCS1SHA256SignatureDescription.cs
Created June 9, 2019 01:37
RSAPKCS1SHA256SignatureDescription.cs
using System.Security.Cryptography;
namespace Sample
{
/// <summary>
/// SignatureDescription impl for http://www.w3.org/2001/04/xmldsig-more#rsa-sha256
/// </summary>
public class RSAPKCS1SHA256SignatureDescription : SignatureDescription
{
/// <summary>
@drawcode
drawcode / imdb.py
Created June 4, 2019 21:09
imdb.py
__author__ = 'Sid'
import requests
from bs4 import BeautifulSoup
import csv
# search = "game of thrones"
search = "person of interest"
# search = "friends"
# search = "rome"
@drawcode
drawcode / DraggableBox.js
Created May 19, 2019 15:22
DraggableBox
var DraggableBox = new Class({
initialize: function(x, y, w, h) {
this.width = w || 15;
this.height = h || 15;
if (y == null ) {
this.center = new ClPoint(0, 0, x);
} else {
this.center = new ClPoint(x, y);
}
this.cvt();
@drawcode
drawcode / cert_convert.sh
Created March 21, 2019 04:36 — forked from jmervine/cert_convert.sh
openssl: convert cert from p7b to crt (or cer)
openssl pkcs7 -print_certs -in old.p7b -out new.crt
# openssl pkcs7 -print_certs -in old.p7b -out new.cer
@drawcode
drawcode / unity-vector3-refract.cs
Created January 6, 2019 07:14
unity-vector3-refract.cs
/**
* returns:
* normalized Vector3 refracted by passing from one medium to another in a realistic manner according to Snell's Law
*
* parameters:
* RI1 - the refractive index of the first medium
* RI2 - the refractive index of the second medium
* surfNorm - the normal of the interface between the two mediums (for example the normal returned by a raycast)
* incident - the incoming Vector3 to be refracted
*
@drawcode
drawcode / fraksl.pde
Created November 26, 2018 21:10 — forked from nimaid/fraksl.pde
Fraksl Processing Script
/*
A port of the Fraksl Android App by Ella Jameson
WASD to move, QE to rotate, [UP][DOWN] to zoom, P to take a picture in the sketch directory
*/
void mirror_screen()
{
loadPixels();
for(int row = 0; row < height; row++)
{
@drawcode
drawcode / how-software-companies-die.txt
Created August 17, 2018 05:12
How Software Companies Die - Orson Scott Card
==========================
How Software Companies Die
==========================
- Orson Scott Card
The environment that nurtures creative programmers kills management and
marketing types - and vice versa.
Programming is the Great Game. It consumes you, body and soul. When
you're caught up in it, nothing else matters. When you emerge into
@drawcode
drawcode / native-events.css
Created July 26, 2018 19:24
native-events-js
div {
padding:1em;
margin:1em;
background:#dadada;
}
@drawcode
drawcode / generate-ssh-key.sh
Last active July 16, 2018 08:59 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "email@example.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "email@example.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "email@example.com" -f ~/.ssh/mozilla_rsa