Skip to content

Instantly share code, notes, and snippets.

@haschek
haschek / _contrast.scss
Last active August 14, 2019 14:20
SCSS/SASS Accessibility Color Methods
/*
SCSS Color Methods for Accessibility
================================================================================
Adjust given colors to ensure that those color combination provide sufficient
contrast.
@version 0.1
@link http://eye48.com/go/scsscontrast
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
# custom login link
RewriteRule ^login$ http://localhost/whitelabel/wp-login.php [NC,L]
@trepmal
trepmal / notepad.js
Created November 16, 2011 21:35
WordPress: Front-end editable notepad
jQuery(document).ready(function($) {
$('#notepad').click(function(e) {
tag = e.target.tagName;
if ( tag != 'TEXTAREA' && tag != 'INPUT' ) {
contents = $(this).html();
$(this).html( '<textarea style="display:block;width:98%;height:100px;">' + contents + '</textarea><input type="submit" class="save" style="position:relative;z-index:99" />' );
}
});
$('#notepad input.save').live( 'click', function() {
@kleinmatic
kleinmatic / propubnerd-gists.md
Created March 26, 2012 16:03
ProPubNerd Gists

Open Source code doesn’t always come in big complex packages. At ProPublica we sometimes share small, simple snippets of using GitHub "Gists." These Gists range from single-byte file delimiters to an entire JavaScript framework for making stepper graphics. They rarely have documentation and don’t even always have names, but they can be super-useful. Here are some we’ve shared over the past few years:

@mkchandler
mkchandler / Setting up SourceGear DiffMerge for Git.md
Last active January 13, 2022 10:44
Setup guide for making Git recognize and use SourceGear DiffMerge.
  1. Download SourceGear DiffMerge: http://sourcegear.com/diffmerge/index.html

  2. Add the following to your global .gitconfig file:

     [diff]
         tool = DiffMerge
     [difftool "DiffMerge"]
         cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' "$LOCAL" "$REMOTE"
     [merge]
    

tool = DiffMerge

@cfarm
cfarm / github-flow.md
Last active August 29, 2015 14:03
Github Flow

Workflow for Git and Github

  1. Create a new branch from master:

  2. git checkout master or git status to confirm you're working on master

  3. git branch my-new-branch

  4. Check out the new branch!!!

git checkout my-new-branch

@geerteltink
geerteltink / gulpfile.js
Created March 10, 2015 08:18
NPM scripts VS gulp.js
var gulp = require('gulp');
var cp = require('child_process');
var del = require('del');
var concat = require('gulp-concat');
var shell = require('gulp-shell');
var express = require('express');
var livereload = require('gulp-livereload');
var plumber = require('gulp-plumber');
var notify = require('gulp-notify');
var less = require('gulp-less');
@paulirish
paulirish / what-forces-layout.md
Last active November 15, 2024 16:45
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