Skip to content

Instantly share code, notes, and snippets.

@thelucre
thelucre / 0_reuse_code.js
Last active August 29, 2015 14:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
window.bboxInit = function () {
bbox.showForm('####################');
};
(function () {
var e = document.createElement('script'); e.async = true;
e.src = 'https://bbox.blackbaudhosting.com/webforms/bbox-min.js';
document.getElementsByTagName('head')[0].appendChild(e);
} ());
@thelucre
thelucre / transparentbg-unity-webgl.jslib
Last active August 11, 2023 07:44
Transparent WebGL Rendering
// Source: http://forum.unity3d.com/threads/webgl-transparent-background.284699/#post-1880667
// Clears the WebGL context alpha so you can have a transparent Unity canvas above DOM content
// Add this .jslib to your project et voila!
var LibraryGLClear = {
glClear: function(mask)
{
if (mask == 0x00004000)
{
var v = GLctx.getParameter(GLctx.COLOR_WRITEMASK);
if (!v[0] && !v[1] && !v[2] && v[3])
#!/usr/bin/env python3
from two1.wallet import Wallet
from two1.bitrequests import BitTransferRequests
# set up bitrequest client for BitTransfer requests
wallet = Wallet()
requests = BitTransferRequests(wallet)
# server address
server_url = 'http://localhost:5000/'
intro:
title: The honest to goodness process.
body,wysiwyg: <p>Quae duo sunt, unum facit. Naturales divitias dixit parabiles esse, quod parvo esset natura contenta. Si enim ad populum me vocas, eum. Duo Reges: constructio interrete. Fortasse id optimum, sed ubi illud: Plus semper voluptatis? Non est igitur voluptas bonum. Compensabatur, inquit, cum summis doloribus laetitia.</p>
services:
title,textarea:
value: We’re a digital first agency based in Northern California with over 15 years of experience creating digital interactions, and engaging content that connects businesses, brands, and users alike.
help: The title of the <b>Services</b> equation which is shown throughout the site.
project_title,textara:
value: Services this project included:
@thelucre
thelucre / ColorShaderScript.cs
Last active March 17, 2017 02:12
Color Shader
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ColorShaderScript : ShaderBaseScript {
void Update()
{
mat.SetColor("_Color", Color.white * new Vector4(
0.5f * Mathf.Sin(Time.timeSinceLevelLoad) + 0.5f,
@thelucre
thelucre / ColorFromNormals.shader
Created March 17, 2017 02:13
Color From Normals
Shader "Custom/ColorFromNormals" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
}
SubShader {
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// include file that contains UnityObjectToWorldNormal helper function
Shader "Custom/ModulusDiscardSizing" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
}
SubShader {
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
@thelucre
thelucre / SimplexNoise2D.Shader
Created March 17, 2017 05:11
Simplex Noise Shader Unity
Shader "Custom/SimplexNoise2D" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_Color2 ("Color2", Color) = (1,1,1,1)
_Color3 ("Color3", Color) = (1,1,1,1)
_Color4 ("Color4", Color) = (1,1,1,1)
}
SubShader {
Pass {
CGPROGRAM
@thelucre
thelucre / VertexColor.shader
Created July 25, 2018 20:18
Unity: Vertex Color Shader with Flat Color option
// Renders vertex colors on a mesh.
// Flat Shaded flag will ignore light. Useful for static Quill models
Shader "Custom/VertexColor" {
Properties {
[Toggle(FLAT_SHADED)]
_FlatShaded ("Flat Shaded", Float) = 0
}