Skip to content

Instantly share code, notes, and snippets.

View pierreburel's full-sized avatar

Pierre Burel pierreburel

View GitHub Profile
@atnan
atnan / spring-utils.js
Created October 13, 2018 15:13
Functions to convert spring parameters to and from mass/stiffness/damping and damping ratio/frequency response.
function convertDampingRatioResponseToStiffnessDamping(dampingRatio, response) {
let mass = 1
let angularFrequency = (2 * Math.PI) / response
let stiffness = Math.pow(angularFrequency, 2) * mass
let damping = dampingRatio * (2 * Math.sqrt(stiffness * mass))
return { mass: mass, stiffness: stiffness, damping: damping }
}
function convertMassStiffnessDampingToDampingRatioResponse(mass, stiffness, damping) {
@tunguskha
tunguskha / Gradient shadow in pure CSS.md
Last active May 4, 2023 06:40
Gradient shadow in pure CSS

Gradient shadow in pure CSS

alt text

HTML
<button>Let's Go !</button>
@peterdemartini
peterdemartini / command.sh
Last active May 20, 2024 11:04
Exclude node_modules in timemachine
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
@danielantelo
danielantelo / microdata_resume_cv.html
Last active July 6, 2023 09:48
HTML5 Microdata Resume (Curriculum) Template
<!DOCTYPE html>
<html>
<head>
<!-- Meta conf -->
<meta charset="UTF-8">
<!-- Meta info -->
<title>HTML5 Microdata Resume (CV) Template</title>
<meta name="description" content="An example of how to layout a semantic html5 page for a curriculum vitae/resume">
<meta name="keywords" content="template, html, semantic, microdata, resume, cv, curriculum, vitae">
</head>
@paulirish
paulirish / what-forces-layout.md
Last active July 14, 2024 22:25
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@ericelliott
ericelliott / essential-javascript-links.md
Last active May 17, 2024 03:38
Essential JavaScript Links
@namuol
namuol / INSTALL.md
Last active July 24, 2023 11:53
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@rafaelrinaldi
rafaelrinaldi / naming.md
Created January 24, 2014 18:58
How to name the sub elements of sub elements on SMACSS?

What to do when you have sub elements that have sub elements? How to name them?

Always namespace to the module name + __ + the sub element no matter what?

<section class="foo">

  <!-- Regular sub element -->
  <div class="foo__chart">
    I'm a chart
@sindresorhus
sindresorhus / post-merge
Last active May 2, 2024 03:18
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"