Skip to content

Instantly share code, notes, and snippets.

DELETE pm
FROM wp_postmeta pm
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id
WHERE wp.ID IS NULL
// iframes
var $iframes = $( document.querySelectorAll( '.widget iframe' ) );
function iframeSizing() {
var $this = $( this ),
width = $this.width(),
height = $this.height(),
containerWidth = $this.parent().width(),
heightRatio = height / width,
newHeight = heightRatio * containerWidth;
@crystalw
crystalw / .bash_profile
Created April 6, 2016 20:38
bash aliases
#opens chrome with CORS disabled
alias chromex='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security'
#removes merged local branches (except for master)
alias gitprune='git branch --merged | grep -v "\*" | grep -v master | xargs -n 1 git branch -d'
#switches to ui project
alias backend="cd ${PWD/ui/backend}"
#switches to backend project
@crystalw
crystalw / SassMeister-input.scss
Created April 14, 2016 07:52 — forked from davidkpiano/SassMeister-input.scss
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
$scotch-color-key: 'base' !default;
$scotch-colors: (
'primary': (
'base': #8e3329,
@crystalw
crystalw / pseudo-elements.md
Created April 15, 2016 21:41 — forked from p3t3r67x0/pseudo_elements.md
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] {
@crystalw
crystalw / SCSS.md
Created March 26, 2017 00:07 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso