Skip to content

Instantly share code, notes, and snippets.

View kenjinp's full-sized avatar
🇺🇸

Kenneth Pirman kenjinp

🇺🇸
View GitHub Profile
@Kenrick-Zhou
Kenrick-Zhou / devise.zh-CN.yml
Last active November 23, 2019 11:41 — forked from acenqiu/devise.zh-CN.yml
rails devise 3.5.2 I18n translations zh-CN
# Chinese (China) translations for Devise(3.5.2)
# by Kenrick-Zhou (https://github.com/Kenrick-Zhou)
# https://gist.github.com/Kenrick-Zhou/7909822
zh-CN:
devise:
confirmations:
confirmed: "您的帐号已经确认,您现在已登录。"
send_instructions: "几分钟后,您将收到确认帐号的电子邮件。"
send_paranoid_instructions: "如果您的邮箱存在于我们的数据库中,您将收到一封确认账号的邮件。"
@ogckw
ogckw / ec2-node-amzn.sh
Last active July 15, 2021 20:24
ec2-amazon-linux-node-userdata
#!/bin/bash
# Program:
# EC2 initially install node.js, git for development environment.
# You can modify nodev and nvmv for changing node and nvm version.
# Set permission to ec2-user install above.
# History:
# 2017/07/25 Hans First release
home=/home/ec2-user
nodev='8.11.2'
nvmv='0.33.11'
@matwerber1
matwerber1 / ec2-node-amzn.sh
Created September 26, 2018 02:57 — forked from ogckw/ec2-node-amzn.sh
ec2-amazon-linux-node-userdata
#!/bin/bash
# Program:
# EC2 initially install node.js, git for development environment.
# You can modify nodev and nvmv for changing node and nvm version.
# Set permission to ec2-user install above.
# History:
# 2017/07/25 Hans First release
home=/home/ec2-user
nodev='8.11.2'
nvmv='0.33.11'
@kenjinp
kenjinp / CapsuleBufferGeometry.ts
Last active October 24, 2021 14:41
A threejs capsule geometry! CapulseBufferGeometry: for creating capsules using threejs and typescript. Especially helpful for games
import * as THREE from "three";
import { BufferGeometry } from "three";
/**
* Capsule Geometry
* especially helpful in 3D games
* original creator:
* @author maximequiblier
*
* Modified for typescript (partially)
@itsdouges
itsdouges / cascaded-shadow-map.tsx
Created November 16, 2022 23:17
Cascaded Shadow Maps for React Three Fiber
import { useFrame, useThree } from '@react-three/fiber';
import { useLayoutEffect, useMemo } from 'react';
import { Camera, Vector3, Vector3Tuple } from 'three';
import CSM, { Params } from 'three-csm';
interface CascadedShadowMapProps extends Omit<Params, 'lightDirection' | 'camera' | 'parent'> {
fade?: boolean;
lightDirection?: Vector3Tuple;
}
@Ctrlmonster
Ctrlmonster / makeContinuable.ts
Created January 6, 2023 18:45
small helper function to promisify via callbacks
export type Work = (...args: any[]) => any;
// Pass a function that provides a callback as single argument and returns another function F that calls that
// callback at some point. The result of makeContinuable will be a function that returns a promise that will
// resolve to the return value of F, once the callback is called.
export function makeContinuable<F extends Work>(wrapperFn: (cb: () => void) => F) {
return async (...args: Parameters<F>) => {
const outerPromise = new Promise<ReturnType<F>>(async (resolve1) => {
let res = null as ReturnType<F>;
// create another promise in whose executioner we'll call the passed function
// Local imports
import { useAnimatedFavicon } from './useAnimatedFavicon.js'
export function AnimatedFavicon() {
useAnimatedFavicon({
imageURL: '/favicon-spritesheet.png',