Skip to content

Instantly share code, notes, and snippets.

View franklinharvey's full-sized avatar
👨‍🌾
out on the farm

Franklin H franklinharvey

👨‍🌾
out on the farm
View GitHub Profile
@athiththan11
athiththan11 / pre-commit
Last active December 5, 2023 21:11
Git Pre Commit Hook for FIXME TODO
#!/bin/sh
# An hook script to verify changes to be committed do not contain
# any 'FIXME:' comments. Called by "git commit" with no arguments.
#
# The hook should exit with non-zero status after issuing an appropriate
# message if it stops the commit.
#
# To bypass this hook, use the "--no-verify" parameter when committing.
@basarat
basarat / cardinaldirections.js
Last active November 14, 2022 17:44
Snapping an angle to the nearest cardinal direction in javascript
/**
* Given "0-360" returns the nearest cardinal direction "N/NE/E/SE/S/SW/W/NW"
*/
export function getCardinal(angle) {
/**
* Customize by changing the number of directions you have
* We have 8
*/
const degreePerDirection = 360 / 8;
@gre
gre / easing.js
Last active May 17, 2024 03:33
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {