Skip to content

Instantly share code, notes, and snippets.

View travismillerweb's full-sized avatar

Travis Miller travismillerweb

View GitHub Profile
@travismillerweb
travismillerweb / SassMeister-input.sass
Created January 30, 2014 05:54 — forked from scottkellum/SassMeister-input.sass
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.7)
// ----
=e($name)
@at-root #{&}__#{$name}
@content
=m($name)
@at-root #{&}--#{$name}
@travismillerweb
travismillerweb / bitly-api.js
Created February 1, 2014 21:59
JS - Bitly API
/*
Reference Link: http://stackoverflow.com/questions/4760538/using-only-javascript-to-shrink-urls-using-the-bit-ly-api
*/
function get_short_url(long_url, login, api_key, func)
{
$.getJSON(
"http://api.bitly.com/v3/shorten?callback=?",
@travismillerweb
travismillerweb / full-frame-bg-cover.css
Created February 7, 2014 14:18
CSS - Full Frame Background Cover
.full-background {
background: url("../img/header-image-2.jpg") 50% 0 repeat fixed;
min-height: 800px;
height: 800px;
margin: 0 auto;
width: 100%;
max-width: 1920px;
position: relative;
-webkit-background-size: cover;
-moz-background-size: cover;
@travismillerweb
travismillerweb / facebook-twitter-meta.html
Created February 12, 2014 02:28
HTML - Facebook/Twitter Social Metatags
<!-- Facebook Meta Tags -->
<meta property="og:title" content="">
<meta property="og:description" content="">
<meta property="og:image" content="">
<meta property="og:image:secure_url" content="">
<meta property="og:image:type" content="">
<meta property="og:image:width" content="">
<meta property="og:image:height" content="">
<!-- Twitter Meta Tags -->
@travismillerweb
travismillerweb / exist-cjecker.js
Created February 13, 2014 14:38
JS - Exist Checker Polling
var checkExist = setInterval(function() {
if ($('.shareable').length > 0) {
console.log("Exists!");
braggingSeason.getPageNames();
clearInterval(checkExist);
}
}, 100);
@travismillerweb
travismillerweb / section-scrolling.js
Created February 13, 2014 17:44
JS - Section Scrolling Ease
sectionScrolling: function () {
$('.specialized-practice-menu li a[href*=#]:not([href=#])').click(function(e) {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top -50
}, 500);
@travismillerweb
travismillerweb / add-remove-rules.js
Created February 18, 2014 21:41
JS - Add and Remove Rules Directly to Stylesheets
/*
JS - Add and Remove Rules Directly to Stylesheets
Reference Site: http://davidwalsh.name/ways-css-javascript-interact
*/
function addCSSRule(sheet, selector, rules, index) {
if(sheet.insertRule) {
@travismillerweb
travismillerweb / .htaccess
Created March 6, 2014 20:38
Apache - Remove .php from File URL
## Remove .php from File URL
## Reference Link: http://stackoverflow.com/questions/15917258/remove-php-from-urls-with-htaccess
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L]
@travismillerweb
travismillerweb / line-on-sides.scss
Last active August 29, 2015 13:57
Sass - Line On SIdes Headers
/*
Sass - Line On Side Headers
Reference Link: http://css-tricks.com/line-on-sides-headers/
Implementation Example: <h1 class="fancy"><span>Title</span></h1>
*/
@travismillerweb
travismillerweb / duplicate-copy-method.js
Created March 30, 2014 16:31
JS - Duplicate and Copy Element's Methods
/*
JS - Duplicate and Copy Element's Methods
Take a method associate with an existing HTML element and add it to another element.
Reference Link: https://forum.jquery.com/topic/how-do-i-copy-the-click-event-from-one-element-to-another.
Tip: Know how your mouseevents or other actions work, you may need to break down certain steps in order to get the functionality you require.