Skip to content

Instantly share code, notes, and snippets.

@robinvdvleuten
robinvdvleuten / up-transition.js
Created May 1, 2020 14:14
Add support for Tailwind transitions in Unpoly
import { getUpAttributes } from "./utils"
function transition(element, stages) {
stages.start()
stages.during()
requestAnimationFrame(() => {
// Note: Safari's transitionDuration property will list out comma separated transition durations
// for every single transition property. Let's grab the first one and call it a day.
let duration = Number(getComputedStyle(element).transitionDuration.replace(/,.*/, '').replace('s', '')) * 1000
@abriemme
abriemme / reply_regex.py
Last active August 29, 2015 14:09
Email reply parser (python) fr+en
import re
REPLY_SPLITTER_REG = re.compile(r"^From:\s*[a-zA-Z0-9.\+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}|^From:\s.*\[mailto:[a-zA-Z0-9.\+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\]|^On\s.*\s<[\s|][a-zA-Z0-9.\+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}>[\s|]wrote:$|^On\s.+?wrote:$|^Le\s.*\s<[\s|][a-zA-Z0-9.\+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}>[\s|]a\sécrit\s:$|^Le\s.+?a\sécrit\s:$|^.*<[a-zA-Z0-9.\+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}>.*$|^-+[\s|]Message\stransféré[\s|]-+$|^-+[\s|]Original\s+Message[\s|]-+$|^-+[\s|]Reply Message[\s|]-+$|^Sent.*from.*my.*|^envoyé\s+depuis\s+mon.*| ^envoyé\s+de\s+mon.*|^" + 'reply above this line' + "|^↑ Merci de répondre par dessus cette ligne ↑$|^-- $|^>\s|^[-|_]{3,}$|^\*{5,}DISCLAIMER\*{5,}$|^—$", re.I | re.M)
#try it here : http://regex101.com/r/oE7sC7/3
@abriemme
abriemme / gist:6304870
Last active December 21, 2015 12:19 — forked from hileon/gist:1311735

Sublime Text – Useful Shortcuts

General

Ctrl+KB toggle side bar
Ctrl+Shift+P command prompt
Ctrl+` python console
Ctrl+N new file

Editing

@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active July 4, 2024 13:00
Backend Architectures Keywords and References
@addyosmani
addyosmani / jQueryPluginPatterns.js
Created August 31, 2011 18:02
jQuery Plugin Patterns
/*
A (very) WIP collection of optimized/recommended jQuery plugin patterns
from @addyosmani, @cowboy, @ajpiano and others.
Disclaimer:
-----------------------
Whilst the end-goal of this gist is to provide a list of recommended patterns, this
is still very much a work-in-progress. I am not advocating the use of anything here
until we've had sufficient time to tweak and weed out what the most useful patterns