Skip to content

Instantly share code, notes, and snippets.

View jdsteinbach's full-sized avatar
💭
💻

James Steinbach jdsteinbach

💭
💻
View GitHub Profile
@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.

@wpexplorer
wpexplorer / gist:8086713
Last active January 1, 2016 03:39
Add a shopping cart icon to WooCommerce products menu item in the WP 3.8 dashboard
// Remove WooCommerce menu.css on WP 3.8+
add_action( 'admin_print_styles', 'wpex_remove_woocommerce_admin_menu_styles' );
if ( ! function_exists('wpex_remove_woocommerce_admin_menu_styles') ) {
function wpex_remove_woocommerce_admin_menu_styles() {
global $wp_version;
if ( $wp_version >= 3.8 ) {
wp_dequeue_style( 'woocommerce_admin_menu_styles' );
}
}
}
// --------------------------------------------------------------------------------------
// A More Modern Scale for Web Typography
// Based on this article: http://typecast.com/blog/a-more-modern-scale-for-web-typography
// --------------------------------------------------------------------------------------
$body-font-size: 1em !default;
// Adjusts body typography to be default
// for each browser.
@mixin reset-body-font-size($font-size: 100%, $size-adjustment: 0.5) {
@n00neimp0rtant
n00neimp0rtant / gist:9515611
Last active September 5, 2024 09:24
simple squash without rebase
## within current branch, squashes all commits that are ahead of master down into one
## useful if you merged with upstream in the middle of your commits (rebase could get very ugly if this is the case)
## commit any working changes on branch "mybranchname", then...
git checkout master
git checkout -b mybranchname_temp
git merge --squash mybranchname
git commit -am "Message describing all squashed commits"
git branch -m mybranchname mybranchname_unsquashed
git branch -m mybranchname
@carlalexander
carlalexander / AdminPage.php
Last active September 5, 2024 01:47
WordPress and the single responsibility principle
<?php
namespace WPMemeShortcode;
/**
* The WordPress Meme Shortcode admin page.
*
* @author Carl Alexander
*/
class AdminPage
@EvanK
EvanK / cap2.sh
Created May 27, 2014 19:56
Deploying specific branch/committish in Capistrano 2 vs 3
# -S key=value
cap staging deploy -S branch=42-super-awesome-feature-branch
// HTML:
<div class="display-type"></div>
// CSS:
// set the content of an element depending on the media query
@chriscoyier
chriscoyier / frontendplugins.md
Last active March 3, 2021 17:31
How WordPress Plugins Should Handle Front End Resources

How WordPress Plugins Should Handle Front End Resources

This is a WORK IN PROGRESS intended for fleshing out and feedback

It's very common for people to be unhappy with how a WordPress plugin adds front end resources to their site. If a plugin needs CSS, the plugin will add a <link> element to that CSS. If the plugin needs JavaScript, it will add a <script> to that JavaScript.

Plugins do this because it works. It's damn important for a WordPress plugin to work, even in adverse conditions. They rightfully want good ratings and little customer support.

But this comes at the cost of additional HTTP requests. In optimizing front end performance of a site, reducing the number of HTTP requests is a huge thing. Front end developers want to decide and control how front end resources are being handled, and WordPress plugins don't typically make this easy on them.

@lunelson
lunelson / gulpfile.js
Last active August 29, 2015 14:09
Configuration to run sassc on a single file in test subdir of libsass/sassc in libsass repo
// _ __ _ _
// | | / _(_) |
// __ _ _ _| |_ __ | |_ _| | ___
// / _` | | | | | '_ \| _| | |/ _ \
// | (_| | |_| | | |_) | | | | | __/
// \__, |\__,_|_| .__/|_| |_|_|\___|
// __/ | | |
// |___/ |_|
var gulp = require('gulp');
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active November 2, 2024 12:19
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {