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 / test-loading-gradient-animated.css
Created March 8, 2021 00:46
test-loading-gradient-animated.css
.animated-text {
box-sizing: border-box;
margin: 8px;
width: 66.6667%;
background: linear-gradient(to right, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.1) 40%, rgba(0, 0, 0, 0) 100%) no-repeat rgba(0, 0, 0, 0.1);
position: relative;
min-height: 4px;
min-width: 100px;
animation-duration: 1.5s;
animation-fill-mode: forwards;
@drawcode
drawcode / jssimple.js
Created June 21, 2020 06:45
jssimple.js
const $T = text => document.createTextNode(text)
function $E(tag, props, kids) {
const elem = document.createElement(tag)
for (const k in props) {
elem[k] = props[k]
}
for (const kid of kids) {
elem.appendChild(kid)
}
@drawcode
drawcode / dotnet-url-track.cs
Created May 19, 2020 17:11
App/Url Tracking
public static string GetChromeUrl(Process process)
{
if (process == null)
throw new ArgumentNullException("process");
if (process.MainWindowHandle == IntPtr.Zero)
return null;
AutomationElement element = AutomationElement.FromHandle(process.MainWindowHandle);
if (element == null)
@drawcode
drawcode / AwesomeStruct.cpp
Created April 25, 2020 07:04 — forked from hanzochang/AwesomeStruct.cpp
[UE4(Unreal Engine 4)] Example for parsing json and creating struct instance from parsed json.
#include "ProcedualSpline.h"
#include "AwesomeStruct.h"
FAwesomeStruct FAwesomeStruct::BuildAwesomeStruct(
FVector AwesomeVector,
bool AwesomeBoolean,
float AwesomeFloat,
int32 AwesomeInteger,
FRotator AwesomeRotator
)
@drawcode
drawcode / custom_game_engines_small_study.md
Created April 24, 2020 19:20 — forked from raysan5/custom_game_engines_small_study.md
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) becaus

@drawcode
drawcode / publickey-git-error.markdown
Created April 5, 2020 03:45 — forked from adamjohnson/publickey-git-error.markdown
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th
// For use with e.g. Media Player Classic
// (c) Mindbleach 2020 , no rights reserved
// Treat as licensed under MIT if that makes life easier for you.
// After https://www.reddit.com/r/ContagiousLaughter/comments/fim6di/watching_twilight_on_a_poorly_hung_projector/
sampler s0 : register(s0);
float4 main(float2 tex : TEXCOORD0) : COLOR
{
function getParameterByName (name)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name.toLowerCase() + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.search.toLowerCase());
if (results == null)
return "";
else
return decodeURIComponent(results[1].replace(/\+/g, " "));
@drawcode
drawcode / .gpu-instancing.md
Last active February 14, 2023 16:19
Unity GPU Instancing

https://docs.unity3d.com/Manual/GPUInstancing.html

GPU Instancing (Unity)

Introduction

Use GPU Instancing to draw (or render) multiple copies of the same Mesh at once, using a small number of draw calls. It is useful for drawing objects such as buildings, trees and grass, or other things that appear repeatedly in a Scene .

GPU Instancing only renders identical Meshes with each draw call, but each instance can have different parameters (for example, color or scale) to add variation and reduce the appearance of repetition.

@drawcode
drawcode / drawcode-pulse-slow-blue.glsl
Last active September 1, 2019 14:50
drawcode-shaders.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;