Skip to content

Instantly share code, notes, and snippets.

View jbutko's full-sized avatar

Jozef Butko jbutko

View GitHub Profile
@jbutko
jbutko / script.js
Last active August 29, 2015 14:01
tumblr, js, jQuery: Responsive spotify player
// Make Spotify the right size and responsive
$(document).ready(function(){
$('.mobile-spotify iframe').css('height', '80px');
$('.mobile-spotify iframe').css('width', '290px');
$('iframe[src*="embed.spotify.com"]').each( function() {
$(this).css('width',$(this).parent(1).css('width'));
$(this).css('height', '82');
$(this).attr('src',$(this).attr('src'));
});
});
@jbutko
jbutko / index.html
Created May 23, 2014 12:06
HTML, Media Query, CSS: IE9 and below responsive support
<!-- HTML5 Support in IE LT 9 -->
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<script src="http://static.tumblr.com/myrscmz/nb8mvvfx0/respond.js"></script>
<link href="https://cdn.rawgit.com/scottjehl/Respond/master/cross-domain/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
<link href="http://static.tumblr.com/zsno5u0/Ho3n6104k/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
<script src="http://static.tumblr.com/zsno5u0/cNnn6104q/respond.proxy.js"></script>
<script src="http://static.tumblr.com/uoxxoej/pIdlrxepo/css3-mediaqueries.js"></script>
<![endif]-->
@jbutko
jbutko / start.bat
Created May 26, 2014 11:30
Git: Merge redundand commits into one
git reset --soft HEAD~7
git commit -m "Add stickyNavbar.js"
git push --force
REM From https://github.com/jsdelivr/jsdelivr/pull/843
@jbutko
jbutko / style.css
Created June 3, 2014 19:59
CSS: Make div 100% height of browser window
html, body {
height: 100%; /* IMPORTANT!!! stretches viewport to 100% */
}
#wrapper {
min-height: 100%; /* min. height for modern browser */
height:auto !important; /* important rule for modern Browser */
height:100%; /* min. height for IE */
overflow: hidden !important; /* FF scroll-bar */
}
@jbutko
jbutko / style.css
Created June 4, 2014 09:23
CSS: Font smoothing in Chrome
@font-face {
font-family: 'chunk-webfont';
src: url('../../includes/fonts/chunk-webfont.eot');
src: url('../../includes/fonts/chunk-webfont.eot?#iefix') format('eot'),
url('../../includes/fonts/chunk-webfont.svg') format('svg'),
url('../../includes/fonts/chunk-webfont.woff') format('woff'),
url('../../includes/fonts/chunk-webfont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@jbutko
jbutko / script.js
Created June 4, 2014 13:02
js: window resize event
window.onresize = function() {
// your code
};
@jbutko
jbutko / script.js
Created June 4, 2014 13:04
js: Get window width and height
var w = window,
d = document,
e = d.documentElement,
g = d.getElementsByTagName('body')[0],
x = w.innerWidth || e.clientWidth || g.clientWidth,
y = w.innerHeight|| e.clientHeight|| g.clientHeight;
alert(x + ' × ' + y);
// From http://stackoverflow.com/questions/3437786/how-to-get-web-page-size-browser-window-size-screen-size-in-a-cross-browser-wa
@jbutko
jbutko / main.js
Created June 11, 2014 07:42
jQuery: Document ready boilerplate
$(document).ready(function() {
});
@jbutko
jbutko / scripts.js
Created June 27, 2014 12:07
jQuery: Re-enable e.preventDefault() event
$('form').submit( function(ev) {
ev.preventDefault();
//later you decide you want to submit
$(this).unbind('submit').submit()
});
//From http://stackoverflow.com/questions/5651933/what-is-the-opposite-of-evt-preventdefault
@jbutko
jbutko / index.html
Created July 3, 2014 08:43
jQuery, js, JSON: Get twitter tweets
<div id="input">
<span>Enter Twitter Username</span>
<input id="twitterUsername" type="text" value="@john_papa"/>
<button id="getTweets">Get Tweets</button>
</div>
<div id="output"></div>
<!-- via http://jsfiddle.net/johnpapa/YS3u4/light/ -->