Skip to content

Instantly share code, notes, and snippets.

Snugug / performance.js
Last active Mar 15, 2019
A Chrome DevTools Snippet to get page performance numbers. Returns interesting Navigation Timings and Resource Sizing. Unfortunate workaround for content types until hits
View performance.js
function getExt(filename, opts) {
if (!opts) opts = {};
if (!filename) return "";
var ext = (/[^./\\]*$/.exec(filename) || [""])[0];
return opts.preserveCase ? ext : ext.toLowerCase();
async function typeMap () {
const db = await fetch('').then(t => t.json());
Django ORM Optimization Tips
* Only use optimizations that obfuscate the code if you need to.
* Not all of these tips are hard and fast rules.
* Use your judgement to determine what improvements are appropriate for your code.
# ---------------------------------------------------------------------------
ultimatemember / gist:643cd90967e5e415378d
Last active Jun 20, 2020
Custom profile tab example: showing user pages
View gist:643cd90967e5e415378d
/* add a custom tab to show user pages */
add_filter('um_profile_tabs', 'pages_tab', 1000 );
function pages_tab( $tabs ) {
$tabs['pages'] = array(
'name' => 'Pages',
'icon' => 'um-faicon-pencil',
'custom' => true
return $tabs;
engelfrost / LICENSE
Last active Sep 2, 2020
Fake localStorage. Useful for Safari Private Browsing and browsers that don't implement localStorage.
The MIT License (MIT)
Copyright (c) 2015 Textalk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
tylertadej /
Last active Mar 18, 2021
WebStorm keyboard shortcuts

WebStorm keyboard shortcuts

List of helpful keyboard shortcuts for IntelliJ WebStorm 8 running on OSX
Alt+Up                Select text blocks in incrementing size
Alt+Down              Deselect text blocks in decreasing size
Shift+Shift           Search Everywhere pop-up window
tylertadej /
Last active May 3, 2021
Pro Git commands for Git users

Git Your Act Together

Git Setup

Global settings stored in a system .gitconfig file; view file using $ cat ~/.gitconfig
Single repo settings stored in /.git/config in your project folder
View current configurations in the terminal window
$ git config --list
$ git config <level> --list
View _brightness.scss
// Brightness math based on:
$red-magic-number: 241;
$green-magic-number: 691;
$blue-magic-number: 68;
$brightness-divisor: $red-magic-number + $green-magic-number + $blue-magic-number;
@function brightness($color) {
// Extract color components
View patch-edid.rb
# Create display override file to force Mac OS X to use RGB mode for Display
# see
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
Adirael /
Created Aug 17, 2012
Fix wordpress file permissions
# This script configures WordPress file permissions based on recommendations
# from
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
Zodiac1978 / .htaccess
Last active May 21, 2021
Make your Website faster - a safe htaccess way
View .htaccess
# Sources: