Skip to content

Instantly share code, notes, and snippets.

// aspect-ratio()
//
// Use on a container that you want to maintain a specific aspect ratio when scaling
//
// $width - in pixels
// $height - in pixels
@mixin aspect-ratio($width, $height) {
position: relative;
setttings
var gulp = require('gulp');
var minifycss = require('gulp-minify-css');
var autoprefixer = require('gulp-autoprefixer');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
gulp.task('css', function() {
return gulp.src('sass/main.sass')
.pipe(sass({ style: 'compressed' }))
.pipe(autoprefixer('last 15 version'))
@embolden
embolden / gist:6676572
Created September 23, 2013 20:37
OSX find to delete any WordPress generated thumbnail with 1-4 digits x 1-4 digits of height/width.
find -E . -regex ".*-[[:digit:]]{1,4}x[[:digit:]]{1,4}.(jpg|png|gif)" -exec rm {} \;
@neonexus
neonexus / Git Shortcuts.md
Last active November 13, 2018 04:46
Git shortcuts

Git Shortcuts

What do they do?

The following blob is a set of basic setup configuration for Git, along with some shortcuts that I personally use.

Here we assume that you are working on your own, local branch (basically, not the master).

The shortcuts and what they do

@ericjuden
ericjuden / create-sample-tables.php
Last active December 14, 2015 19:29
WordPress Custom Tables
<?php
/*
Plugin Name: Create Sample Tables Plugin
Plugin URI: http://ericjuden.com
Description: Create some dummy tables
Version: 1.0
Author: ericjuden
Author URI: http://ericjuden.com
*/
@arod2634
arod2634 / custom-wp-toolbar.php
Created September 30, 2012 01:41
Customize Wordpress Admin Toolbar
<?php
// Customize Admin toolbar if you do desiced to keep it around...
function change_toolbar($wp_toolbar) {
$wp_toolbar->remove_node('comments');
$wp_toolbar->add_node(array(
'id' => 'myhelp',
'title' => 'Help',
'meta' => array('target' => 'help')
));
$wp_toolbar->add_node(array(
@leostratus
leostratus / webkit-pseudo-elements.md
Created September 21, 2012 01:44
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@Ollo
Ollo / conversion.js
Created May 29, 2012 19:09
conversion tracking via click instead of page view
$('.clickAction').click(function(){
$('<iframe id="converter" height="1" width="1" name="converter" >').attr('src', '<?php bloginfo('template_url'); ?>/tracking.html').appendTo('body');
});
@ijy
ijy / Compass px to em
Created December 7, 2011 08:18
A Compass function to convert pixel font-sizes to em's
@function em($target, $context: $base-font-size) {
@if $target == 0 { @return 0 }
@return $target / $context + 0em;
}
$base-font-size: 15px;
h1 {
font-size: em(21px, 15px); // Outputs 1.4em
}