Skip to content

Instantly share code, notes, and snippets.

View laurent-d's full-sized avatar
😋

Laurent de Lacerda laurent-d

😋
View GitHub Profile
@max-mapper
max-mapper / readme.md
Last active March 16, 2023 15:18
Video stabilization using VidStab and FFMPEG (Mac OS X)

Video stabilization using VidStab and FFMPEG

Examples here use the default settings, see the VidStab readme on GitHub for more advanced instructions.

Here's an example video I made

Install ffmpeg with the vidstab plugin from homebrew

brew install ffmpeg --with-libvidstab
@paulirish
paulirish / what-forces-layout.md
Last active April 30, 2024 17:56
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
@elliotbonneville
elliotbonneville / topkeywords.js
Last active August 23, 2022 10:26
Find top keywords associated with a Google search with this Node.js application.
var request = require("request"),
cheerio = require("cheerio"),
url = "https://www.google.com/search?q=data+mining",
corpus = {},
totalResults = 0,
resultsDownloaded = 0;
function callback () {
resultsDownloaded++;
@elidickinson
elidickinson / max_width_email.html
Created May 6, 2013 15:10
Email Template trick: max-width with outlook
<!--[if mso]>
<center>
<table><tr><td width="580">
<![endif]-->
<div style="max-width:580px; margin:0 auto;">
<p>This text will be centered and constrained to 580 pixels even on Outlook which does not support max-width CSS</p>
</div>
<!--[if mso]>
@hagronnestad
hagronnestad / WordPress: Wrap images in DIV.php
Last active September 27, 2021 19:09
WordPress: Wrap images in DIV.
// =======================
// = WRAP IMAGES IN DIVS =
// =======================
function wrapImagesInDiv($content) {
$pattern = '/(<img[^>]*class=\"([^>]*?)\"[^>]*>)/i';
$replacement = '<div class="image-container $2">$1</div>';
$content = preg_replace($pattern, $replacement, $content);
return $content;
}
@kevinSuttle
kevinSuttle / meta-tags.md
Last active March 31, 2024 14:26 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags
@bmsterling
bmsterling / wpautop_fix
Created May 5, 2011 20:01
Removed the paragraph tag that wordpress' wpautop puts around images.
function wpautop_fix( $content ){
$content = ereg_replace('<p[^>]*>(<img[^>]*>)<\\/p[^>]*>', '\\1', $content);
return $content;
}
add_filter('the_content', 'wpautop_fix');