Skip to content

Instantly share code, notes, and snippets.

@jadepark-dev
jadepark-dev / Dockerfile
Created September 6, 2024 11:22
Dockerfile for Solana Test Validator
FROM debian:bullseye as base
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
WORKDIR /workspace
RUN mkdir -pv "/workspace/bin"
ENV PATH="/workspace/bin:${PATH}"
FROM base as builder
@jadepark-dev
jadepark-dev / array_helpers.ts
Created February 1, 2024 12:47
array_helpers.ts
/**
* Splits an array into chunks of a specified size.
* @param array The array to be chunked.
* @param size The size of each chunk.
* @returns An array of chunks.
*/
export const typedChunkByIndex = <T>(array: T[], size: number): T[][] => {
const chunked: T[][] = []
let index = 0
@jadepark-dev
jadepark-dev / node_fs_helpers.ts
Created February 1, 2024 12:45
node_fs_helpers
import { existsSync, lstatSync, readdirSync, rmdirSync, unlinkSync } from 'fs'
import path from 'path'
/**
* Clears a directory by deleting all its files and sub-folders recursively.
* @param folderPath - The path of the directory to be cleared.
* @throws Error if the folder does not exist.
*/
export function clearDir(folderPath: string) {
if (existsSync(folderPath)) {
/**
* Interface for fetch options.
*/
interface FetchOptions {
method: 'GET' | 'POST' | 'PUT' | 'DELETE'
headers?: Headers
body?: any
}
/**
<script>
jQuery( function( $ ) {
/*-----------------------------------------------------*/
/*-------------------- ON READY------------------------*/
/*-----------------------------------------------------*/
varying vec3 vPositionW;
varying vec3 vNormalW;
uniform float u_intensity;
void main() {
vec3 color = vec3(.58, .74, 1.);
float fresnelTerm = dot(vPositionW, vNormalW) * (1. - u_intensity/2.);
fresnelTerm = clamp(1.0 - fresnelTerm, 0., 1.);
gl_FragColor = vec4( color * fresnelTerm, 1.) * u_intensity;
Number.prototype.map = function(in_min, in_max, out_min, out_max) {
return ((this - in_min) * (out_max - out_min)) / (in_max - in_min) + out_min
}
#region counting functions
public void TextCountTo (int target, Text text) {
if(countingCoroutine != null)
StopCoroutine("CountTo");
countingCoroutine = StartCoroutine(CountTo(target, text));
}
IEnumerator CountTo (int target, Text countText) {
#region counting functions
public void TextCountTo (int target, Text text) {
if(countingCoroutine != null)
StopCoroutine("CountTo");
countingCoroutine = StartCoroutine(CountTo(target, text));
}
IEnumerator CountTo (int target, Text countText) {
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "doeslab/GrabPassBlur" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_BumpAmt ("Distortion", Range (0,128)) = 10
_MainTex ("Tint Color (RGB)", 2D) = "white" {}
_BumpMap ("Normalmap", 2D) = "bump" {}
_Size ("Size", Range(0, 20)) = 1
}