Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mattdesl
mattdesl / MeshCustomMaterial.js
Last active April 5, 2023 08:41
Custom mesh standard material with glslify + ThreeJS r83dev
const glslify = require('glslify');
const path = require('path');
// This is the original source, we will copy + paste it for our own GLSL
// const vertexShader = THREE.ShaderChunk.meshphysical_vert;
// const fragmentShader = THREE.ShaderChunk.meshphysical_frag;
// Our custom shaders
const fragmentShader = glslify(path.resolve(__dirname, 'standard.frag'));
const vertexShader = glslify(path.resolve(__dirname, 'standard.vert'));
@benschmaus
benschmaus / BitwigScriptingDefaultNoteInput.control.js
Last active March 7, 2023 01:59
How NoteInputs, filter masks, and onMidi callbacks work in Bitwig controller scripts
loadAPI(1);
host.defineController("Script Lab", "NoteInput Testing", "1.0", "d5a765f7-647a-488e-938f-dcb653742457");
host.defineMidiPorts(1, 0);
var input;
function init()
{
@vurtun
vurtun / fibers.c
Last active February 27, 2023 05:37
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <stdint.h>
#include <assert.h>
#include <string.h>
#define streq(a, b) (!strcmp((a), (b)))
#ifndef __USE_GNU
#define __USE_GNU
@notlion
notlion / .clang-format
Last active March 15, 2020 06:51
Cinder ClangFormat
---
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: false
AlignConsecutiveAssignments: false
AlignEscapedNewlinesLeft: false
AlignOperands: false
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
#version 150
uniform sampler2D uTexture;
in VertexData {
noperspective vec3 distance;
vec4 color;
vec2 texcoord;
} vVertexIn;
@tealtan
tealtan / instructions.md
Last active December 30, 2016 15:07
Custom Twitter stylesheet

Custom Twitter Stylesheet

Craig Mod does a bigger overhaul with Twitter for Minimalists, but this will only do the following:

  • Hides promoted tweets and trends
  • Hides the useless “Expand” link that appears under every tweet
  • Tones down the blue conversation line to a barely-visible gray
  • Hides all numbers

You can add this CSS in Safari with this extension. The URL to target is twitter.com/*.

@mflux
mflux / ec.js
Created September 23, 2015 23:50
import R from 'ramda';
function newId(){
let d = new Date().getTime();
let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
const r = (d + Math.random()*16)%16 | 0;
d = Math.floor(d/16);
return (c=='x' ? r : (r&0x3|0x8)).toString(16);
});
return uuid;
@num3ric
num3ric / ColorPalette.cpp
Last active August 29, 2015 14:05
Color palette generator
#include "ColorPalette.h"
#include "cinder/CinderAssert.h"
#include "cinder/Rand.h"
#include <algorithm>
#include <numeric>
using namespace ci;
using namespace col;