Instantly share code, notes, and snippets.

View SassMeister-input.scss
// ----
// libsass (v3.2.5)
// ----
$categories: (sell-sheets: #F1B261, trends-reports: #6BBCCF, insights: #A07BA8, recipe-cards: #91B97D, videos: #EA838C);
$properties: (text: color, bg: background-color, border: border-color);
@mixin category_theming($type) {
@each $label, $property in $properties {
View vimeo-js-api.html
<html>
<head></head>
<body>
<!-- NOTE: ?api=1 and player_id at the end of the URL -->
<iframe id="player" width="" height="" src="http://player.vimeo.com/video/62207569?api=1&player_id=player" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
<script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>
<script>
var player = $f(document.getElementById('player'));
View PDO and MySQL.md

PDO (PHP Data Objects)

######Cheat sheet for using PDO to interact with MySQL db's


Used to use MySQL then found out it was being depreciated, this is of course right after I got the hang of it and was almost finished with the project i was using to learn myself. So desided to make the switch to PDO way much easier especially if you have security in mind.

For instance instead of $var = mysql_real_escape_string($_POST['data'];, you just $var = $db->quote($_POST['data'];. Or even better use prepared staements and the underlying driver will not only escape but quote the string for you!

View snippet.md

Go to Sublime Text 2 > Preferences > Key Bindings - User and add this JSON to the file:

[
    { "keys": ["super+shift+l"],
      "command": "insert_snippet",
      "args": {
        "contents": "console.log(${1:}$SELECTION);${0}"
      }
    }
View headings-mixin.scss
/*
SCSS - Sass Mixin for Headings
Reference Link: http://jsfiddle.net/jitendravyas/cxJtc/light/
Also Look at: http://www.elijahmanor.com/nested-maps-for-typesetting-in-sass/
*/
@mixin headings($from: 1, $to: 6){
@for $i from $from through $to{
View shortcode-custom-grid.php
<?php
// PHP - Wordpress Shortcode Functions for Custom Sass Grid
// A Working Shortcode Template for Custom Grid Layouts using Sass
/* =============================================================================
Row Block Shortcode
========================================================================== */
View detect-animation-end.js
/*
Detect Animation End! (Thanks David Walsh)
Reference: http://davidwalsh.name/css-animation-callback
*/
/* From Modernizr */
function whichTransitionEvent(){
var t;
var el = document.createElement('fakeelement');
var transitions = {
View remove-empty-p.php
// Removes P Tags from the_content
// Reference Link: https://coderwall.com/p/vg-i0w
add_filter('the_content', 'remove_empty_p', 20, 1);
function remove_empty_p($content){
$content = force_balance_tags($content);
return preg_replace('#<p>\s*+(<br\s*/*>)?\s*</p>#i', '', $content);
}
View replace-text.css
.class {
visibility:hidden;
color:white;
}
.class:before {
content: "[Replaced Content]";
color:black;
visibility:visible;
}
View redirect-window.js
/*
JS - Redirects & window.open script
Reference URL: http://davidwalsh.name/window-open
(Thanks David Walsh!)
*/