Skip to content

Instantly share code, notes, and snippets.

😎
Shipping product

Ryan Christensen drawcode

😎
Shipping product
Block or report user

Report or block drawcode

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View drawcode-pulse-slow-blue.glsl
//----from http://glslsandbox.com/e#56769.0
//----Removed mouse-dependency, asymetrical from start
//----
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 mouse;
View maskunity.cs
/*
https://answers.unity.com/questions/316064/can-i-obscure-an-object-using-an-invisible-object.html
You can use a special shader that only writes to the depth buffer. That's not so difficult, but you may end with a black area in the screen! The problem is: since this shader doesn't actually draw anything, the area behind the object will remain with the original image, which is defined by the camera's Clear Flags. In order to avoid this, you must handle the rendering order so that the background items are rendered first, then the invisible object, and finally the objects that may be obscured. You can do that by setting the property material.renderQueue of each object, assigning greater values to the ones that should be rendered last (read more about renderQueue values in the shader docs).
The shader itself could be as simple as this one:
*/
Shader "Custom/InvisibleMask" {
SubShader {
View dsigsample.xml
<?xml version="1.0" encoding="UTF-8"?>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI="#object">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>OPnpF/ZNLDxJ/I+1F3iHhlmSwgo=</DigestValue>
</Reference>
</SignedInfo>
@drawcode
drawcode / xmldigsigobject.java
Created Jun 14, 2019
XMl Digital Signature with References and Custom Objects
View xmldigsigobject.java
<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 Jun 9, 2019
RSAPKCS1SHA256SignatureDescription.cs
View 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>
View imdb.py
__author__ = 'Sid'
import requests
from bs4 import BeautifulSoup
import csv
# search = "game of thrones"
search = "person of interest"
# search = "friends"
# search = "rome"
View DraggableBox.js
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 Mar 21, 2019 — forked from jmervine/cert_convert.sh
openssl: convert cert from p7b to crt (or cer)
View cert_convert.sh
openssl pkcs7 -print_certs -in old.p7b -out new.crt
# openssl pkcs7 -print_certs -in old.p7b -out new.cer
View 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 Nov 26, 2018 — forked from nimaid/fraksl.pde
Fraksl Processing Script
View fraksl.pde
/*
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++)
{
You can’t perform that action at this time.