Skip to content

Instantly share code, notes, and snippets.

@blairanderson
blairanderson / conv.sh
Last active December 20, 2021 17:57
Optimize Videos for Web - Compress MP4 and remove Audio with FFMPEG. encodes as 264 with CRF 30, scales down to 1920x1080, strips audio
#! /bin/bash
# The Purpose of this Script is to batch convert and compress any video file to mp4 format
#
# WARNING: LOSSY COMPRESSION !!!
# Variable used:
# sourcedir is the directory where to be converted videos are. Converted video will be saved in the same folder
# usage:
@csabapalfi
csabapalfi / caches-all-the-way-down.md
Last active May 30, 2019 07:41
Caches All the Way Down

Caches all the way down

https://ldnwebperf.org/events/caches-all-the-way-down/

Layers of caching in the browser

(kind of Chromium specific here and there)

1. MemoryCache

  • rendering process specific, short-lived
  • strict matching, same resource type, etc, CSP
  • everything (even no-cache, except for no-store)
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 8, 2026 14:09
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@aaronwaldon
aaronwaldon / 1) readme.md
Last active March 24, 2023 14:25
How to set up Gulp for Craft CMS. Includes SASS compilation and minification, JavaScript minification, livereloading, and browser sync.

How to set up Gulp with a Craft CMS project

I freaking love working with technologies like Gulp, and wanted to share how to get my current Craft front-end workflow set up. With a few tweaks, this can also be used with virtually any other sites (I've used it with Laravel, static sites, ExpressionEngine, etc).

Project Directory Structure

  • project root/
    • craft/
      • templates/
  • (your craft template files)
@tkadlec
tkadlec / perf.js
Created April 23, 2015 11:54
Super simple example of adding perf timing to the page display during dev work
(function () {
var perfBar = function(budget) {
window.onload = function() {
window.performance = window.performance || window.mozPerformance || window.msPerformance || window.webkitPerformance || {};
var timing = window.performance.timing,
now = new Date().getTime(),
output, loadTime;
@seanwash
seanwash / README.md
Last active August 29, 2015 14:15
Wordpress Deploy via Grunt
  1. Setup local wordpress install & local wordpress database
  2. Create production database from mysql wizard (make new user password and db)
  3. Setup grunt files from the wordpress root in the console (rememeber you can drag and drop a folder onto the console and hit enter):
  • $ npm init & Fill in relevant details (you can just hit enter a few times)
  • $ npm install grunt --save-dev - install grunt into node_modules folder
  • $ npm install grunt-wordpress-deploy --save-dev - install grunt wordpress deploy into node_modules folder
  • Create gruntfile.js in root & copy and paste below gruntfile.js into yours.
  • Fill in the local and production information
    • Remember that the two path: lines need to have a trailing slash / (lines 37 & 46)
  1. grunt push_files --target=production
@funzeye
funzeye / WordPress Advanced Custom Field - Responsive Image Field
Last active November 26, 2015 21:53
How To Use Responsive Images in WordPress using Advanced Custom Field's image field and the wp-tevko-responsive-images Plugin
<figure>
<?php
$image = get_field('your_image_field_name');
$atts = array(
'imageid' => $image,
'size1' => '0',
'size2' =>'600',
'size3' =>'1000'
);
echo tevkori_responsive_shortcode($atts) ; ?>
@pmanijak
pmanijak / Auto-deploy with git on Webfaction
Last active August 1, 2018 03:25
Setting up a simple auto-deploy with git on Linux
On server
-----------------
# make a git repo
$ mkdir /path/to/repo.git
$ cd /path/to/repo.git
$ git init --bare
# make a post-receive hook
# see the post-receive file in this Gist
# if you're using Node.js
@jonathanstark
jonathanstark / gist:7557847
Last active December 28, 2015 20:29
TechCrunch blog post: png failover
// Failover to PNG if browser can’t hack SVG
if(!Modernizr.svg) {
$('img').each(function(){
this.src = this.src.replace('svg', 'png');
});
}
@davatron5000
davatron5000 / Sublime Text Setup.md
Last active April 15, 2023 15:39
A new user's guide to SublimeText 2. Estimated reading time: 2 mins. Estimated workthrough time: 12 minutes.

Make it useful

  • Install Package Control. For SublimeText 2, paste the following in Terminal:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

From here on out, use Package Control to install everything. +Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.