Skip to content

Instantly share code, notes, and snippets.

View pixelpicosean's full-sized avatar
🏠

Sean Bohan pixelpicosean

🏠
View GitHub Profile
@haroldiedema
haroldiedema / lambert-patch.js
Created December 17, 2017 19:10
Lit both sides equally for double-sided lambert material instances.
THREE.ShaderLib[ 'lambert' ].fragmentShader = THREE.ShaderLib[ 'lambert' ].fragmentShader.replace(
`vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;`,
`
#ifdef DOUBLE_SIDED
reflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );
reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );
reflectedLight.directDiffuse = diffuseColor.rgb;
reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();
extends Node
# HEX GRID MATH FUNCTIONS
#
# for CELL(offset odd-q vertical), AXIAL, and CUBIC coordinates
var CUBE_DIRECTIONS = [
Cube.new(1, -1, 0), Cube.new(1, 0, -1), Cube.new( 0, 1, -1),\
Cube.new(-1, 1, 0), Cube.new(-1, 0, 1), Cube.new( 0, -1, 1)
]
body {
color: #212121;
font-family: "Helvetica Neue", "Calibri Light", Roboto, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
letter-spacing: 0.02em;
}
@jdryg
jdryg / _instructions.md
Last active August 14, 2018 17:15
bgfx shader custom MSBuild rule for VS2013

Installation

  1. Download all 3 files and place them at the same folder as your VS solution
  2. Build shaderc and move the executable to the same folder. If you get the original executable from the build directory, remember to rename it to shaderc.exe instead of shadercRelease.exe
  3. Open your solution into VS, right click on the project and select Build Dependencies > Build Customizations...
  4. Click Find existing... and select the bgfxshader.targets file you just created
  5. Add .sc files to your project and they should be treated as bgfx shaders

To verify that the new target works correctly you can right click on an .sc file and select Properties. Item Type property should read "bgfx Shader"

function nvm
bash -c 'source ~/.nvm/nvm.sh; nvm "$@"' nvm $argv
set -l node_dir "$HOME/.nvm/versions/node"
switch (echo $argv[1])
case install
case use
set -l node_version (ls $node_dir | grep $argv[2])
set -l node_version (echo $node_version | cut -d " " -f1)
@jojonas
jojonas / love2d-unpacker.py
Last active April 4, 2025 01:36
Love2d executable unpacker.
import argparse
import os, os.path
import zipfile
import io
def readui32(file):
bytes = file.read(4)
number = bytes[0]
number += bytes[1] << 8
number += bytes[2] << 16
@rezoner
rezoner / easings.js
Created March 2, 2015 17:27
One argument easing equations
/*
A full list of simple easing equations inspired by GIST from greweb - https://gist.github.com/gre/1650294
Equations source - http://gsgd.co.uk/sandbox/jquery/easing/
*/
{
linear: function(t) {
return t
},
inQuad: function(t) {
@Turbo87
Turbo87 / app.js
Created February 15, 2015 04:05
webpack + font-awesome test
require('font-awesome/css/font-awesome.css');
document.body.innerHTML = '<i class="fa fa-fw fa-question"></i>';
@fotinakis
fotinakis / target-application-actions.js
Last active August 29, 2015 14:14
Mixin to make nested Ember components skip bubbling actions to parent components (slightly hacky)
import Ember from 'ember';
/**
Targets a component's actions to bubble immediately to the application controller and
through the route hierarchy, skipping any parent component action handlers.
This allows us to avoid passing redundant args like:
<my-component myAction={{action "myAction"}} myOtherAction={{action "myOtherAction"}}>
...through many layers of nested components, at the cost of highly-coupling the actions
@bobbygrace
bobbygrace / trello-css-guide.md
Last active December 10, 2024 21:04
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?