Skip to content

Instantly share code, notes, and snippets.

Travis Miller tbmiller

Block or report user

Report or block tbmiller

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tbmiller
tbmiller / SassMeister-input.scss
Created Oct 20, 2015
Generated by SassMeister.com.
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}"
      }
    }
@tbmiller
tbmiller / headings-mixin.scss
Created Oct 14, 2014
SCSS - Sass Mixin for Headings
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{
@tbmiller
tbmiller / shortcode-custom-grid.php
Created Oct 7, 2014
PHP - Wordpress Shortcode Functions for Custom Sass Grid
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
========================================================================== */
@tbmiller
tbmiller / detect-animation-end.js
Created Sep 16, 2014
JS - Detect Animation End
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 = {
@tbmiller
tbmiller / remove-empty-p.php
Created Sep 14, 2014
PHP - Remove Empty P Tags from WordPress
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);
}
@tbmiller
tbmiller / replace-text.css
Created Sep 11, 2014
CSS - Replace Text via CSS (Hack)
View replace-text.css
.class {
visibility:hidden;
color:white;
}
.class:before {
content: "[Replaced Content]";
color:black;
visibility:visible;
}
@tbmiller
tbmiller / redirect-window.js
Created Aug 27, 2014
JS - Redirects & window.open script
View redirect-window.js
/*
JS - Redirects & window.open script
Reference URL: http://davidwalsh.name/window-open
(Thanks David Walsh!)
*/
You can’t perform that action at this time.