Skip to content

Instantly share code, notes, and snippets.

View titouanmathis's full-sized avatar
🔧

Titouan Mathis titouanmathis

🔧
View GitHub Profile
@spite
spite / index.svg
Last active March 20, 2021 13:51
WebGL in SVG via foreignObject
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<meta charset=utf-8>
<meta name=viewport content="width=device-width, initial-scale=1">
<title>#merryCSSmas bundle</title>
<style>
* {
box-sizing: border-box;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
@javisperez
javisperez / interceptors.js
Last active December 4, 2022 16:47
Axios interceptor for cache with js-cache
// Usually I use this in my app's config file, in case I need to disable all cache from the app
// Cache is from `js-cache`, something like `import Cache from 'js-cache';`
const cacheable = true,
cache = new Cache();
// On request, return the cached version, if any
axios.interceptors.request.use(request => {
// Only cache GET requests
if (request.method === 'get' && cacheable) {

Index

Preface

Together with HellMood we won this year's (2016) JS1K competition and thought this might be a good opportunity to write about the development process and my motivation behind it. If you're already familiar with JS1K, feel free to skip the next two paragraphs.

@Anthodpnt
Anthodpnt / lerp.js
Created December 16, 2016 12:50
Math - Linear Interpolation
/**
* This gist is for Javascript beginners.
* @author: Anthony Du Pont <antho.dpnt@gmail.com>
* @site: https://www.twitter.com/JsGists
*
* Linear Interpolation is a method to add some natural behaviors to your animations. The more natural
* your animations look like, the better will be the look-and-feel. But what's Linear Interpolation ?
*
* Linear Interpolation, also called `lerp`, is a way of easing your animation. Imagine you want to
* move a box from a position A to a position B. Without the Linear Interpolation, you box will
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@roblevintennis
roblevintennis / gist:865de775fb988bfad9a1
Last active May 7, 2017 20:20
Responsive Inline SVGs Sass Mixin
$svg-container-namespace: '.svg-container';
//Give 'em' 1:1 responsive container by default
#{$svg-container-namespace} {
display: inline-block;
position: relative;
height: 0;
width: 100%;
padding: 0;
//Default for 1:1 aspect ratio
@brandonkelly
brandonkelly / templating.md
Last active February 7, 2024 15:20
Templating in EE vs. Craft
@dominicsayers
dominicsayers / elasticsearch.md
Last active March 2, 2024 15:52
Configuring ElasticSearch to use less memory

What I actually did

/etc/security/limits.conf

elasticsearch hard memlock 100000

/etc/default/elasticsearch