Skip to content

Instantly share code, notes, and snippets.

@matthewsimo
matthewsimo / jest-to-vitest.sh
Created April 26, 2024 14:08 — forked from wojtekmaj/jest-to-vitest.sh
Automatically migrate Jest project to Vitest
#!/bin/bash
# Ensure we're working on the latest version of the main branch
git switch main
git fetch
git pull
# Create a new branch
git switch -c vitest
@matthewsimo
matthewsimo / svgo.json
Created August 30, 2016 10:45 — forked from bendc/svgo.json
Sketch's SVGO Compressor settings
{
"comment": "This is the settings file for the SVGO Compressor Plugin. For more info, please check <https://github.com/BohemianCoding/svgo-compressor>",
"pretty": false,
"indent": 2,
"plugins": [
{
"name": "cleanupAttrs"
},
{
"name": "cleanupEnableBackground"
@matthewsimo
matthewsimo / gist:37044f03bd48645de7ef02d33e2327f4
Created August 8, 2016 21:43 — forked from IanLunn/gist:4666512
Reverse a two-point cubic bezier
/* sample cubic beziers */
linear = [0.250, 0.250, 0.750, 0.750];
ease = [0.250, 0.100, 0.250, 1.000];
easeIn = [0.420, 0.000, 1.000, 1.000];
easeOut = [0.000, 0.000, 0.580, 1.000];
easeInOut = [0.420, 0.000, 0.580, 1.000];
function reverseCubicBezier(cubicBezier) {
return [
1 - cubicBezier[2],
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@matthewsimo
matthewsimo / some.sh
Created October 11, 2012 18:54 — forked from tj/some.sh
change terminal tab name on cd
function tabname {
printf "\e]1;$1\a"
}
if [ x`type -t cd` == "xfunction" ]; then
# previously wrapped cd
eval $(type cd | grep -v 'cd is a function' | sed 's/^cd/original_cd/' | sed 's/^}/;}/' )
else
# builtin
eval "original_cd() { builtin cd \$*; }"
@matthewsimo
matthewsimo / wp_full_page_modification.php
Created July 13, 2012 18:02 — forked from supercleanse/wp_full_page_modification.php
Full page modification in WordPress
<?php
add_action('init', 'fpm_start_output');
add_action('shutdown', 'fpm_end_output');
function fpm_start_output() {
ob_start('fpm_mod_buffer');
}
function fpm_mod_buffer($buffer) {
// Modification ... regexp, etc
@matthewsimo
matthewsimo / webperformant.htaccess
Created February 23, 2012 11:39 — forked from davatron5000/webperformant.htaccess
An .htaccess file for web performance and passing Page Speed and YSlow rules
# Enable GZIP
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</ifmodule>
# Expires Headers - 2678400s = 31 days
<ifmodule mod_expires.c>