Skip to content

Instantly share code, notes, and snippets.

View juliendargelos's full-sized avatar
🌫️

Julien Dargelos juliendargelos

🌫️
View GitHub Profile
@juliendargelos
juliendargelos / _test-spritesheets.md
Last active March 16, 2025 21:55
Test spritesheets created with Sketch and Free Texture Packer.

Test spritesheets

These test sprites are meant to help implementing a spritesheet system. They can be used with free tex packer to test custom configurations, or directly from the pre-generated spritesheets below.

Files

  • sprites.zip
    Raw sprites exported from Sketch as single png files

  • spritesheet-rotated.json

@juliendargelos
juliendargelos / ffmpeg-change-volume.sh
Created June 1, 2021 13:02
FFmpeg command that changes audio volume by factor or relative dB value.
ffmpeg -i input.mp3 -filter:a "volume=0.5" output.mp3
ffmpeg -i input.mp3 -filter:a "volume=5dB" output.mp3
ffmpeg -i input.mp3 -filter:a "volume=-5dB" output.mp3
@juliendargelos
juliendargelos / remove-all-from-docker.sh
Created February 21, 2021 21:37 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@juliendargelos
juliendargelos / imagemagick-gif-from-frames.sh
Last active June 1, 2021 13:04
Imagemagick command that creates a gif from a list of frames.
convert -delay 4 -loop 0 *.png output.gif
# Order the input files by naming them with increasing numbers including leading zeros.
#
# delay (centiseconds):
# 25fps <=> 4
# 30fps <=> 3.33333
# 60fps <=> 1.66667
#
# loop: number of times to cycle through the sequence or 0 for infinity
@juliendargelos
juliendargelos / xcode-freespace.sh
Created July 23, 2020 11:27
Fabio Giolito's Xcode "freespace" alias
# https://twitter.com/fabiogiolito/status/933339627859185664
sudo rm -rf /.DocumentRevisions-V100/
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Developer/Xcode/Archives
rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport
rm -rf ~/Library/Developer/Xcode/watchOS\ DeviceSupport
rm -rf ~/Library/Developer/Xcode/tvOS\ DeviceSupport
rm -rf ~/Library/Caches/com.apple.dt.Xcode
xcrun simctl delete unavailable
// Factorielle de n
const f = n => n === 0 ? 1 : n * f(n - 1)
// Coefficient binomial (nombre de parties de k éléments dans un ensemble de n éléments)
const c = (n, k) => f(n) / (f(k) * f(n - k))
function bezier(t, points) {
const n = points.length - 1
const o = 1 - t
@juliendargelos
juliendargelos / three-arc-edged-path.ts
Created January 23, 2020 09:40
Create 2D arc-edged path from a list of points and radii (wip)
import { Vector2, Path } from 'three'
export function arcEdgedPath(
path: Path,
points: Vector2[],
radius: number,
close?: boolean
): void
export function arcEdgedPath(
@juliendargelos
juliendargelos / three-compute-volume.jsm
Last active December 18, 2019 13:52
Utils for computing three geometries volume
export function computeVolume(geometry) {
return isBufferGeometry(geometry)
? computeBufferGeometryVolume(geometry)
: computeGeometryVolume(geometry)
}
export function computeBufferGeometryVolume(geometry) {
return geometry.index
? computeIndexedBufferGeometryVolume(geometry)
: computeNotIndexedBufferGeometryVolume(geometry)

https://stackoverflow.com/a/3926546/4867982

Lookaround Name What it Does
(?=foo) Lookahead Asserts that what immediately follows the current position in the string is foo
(?<=foo) Lookbehind Asserts that what immediately precedes the current position in the string is foo
(?!foo) Negative Lookahead Asserts that what immediately follows the current position in the string is not foo
`(?
@juliendargelos
juliendargelos / rollup-plugin-web-dependencies.js
Last active October 19, 2019 15:50 — forked from bastienrobert/rollup-plugin-rename-imports.js
Rollup plugin to rename imports in an ES modules
import fs from 'fs'
/**
* @example
* // In rollup.config.js
* export default {
* // ...
* plugins: [
* webDependencies({
* // Use pika cdn by default