Skip to content

Instantly share code, notes, and snippets.

View seanbuscay's full-sized avatar

Sean Buscay seanbuscay

View GitHub Profile
git remote -v
# View existing remotes
# origin https://github.com/user/repo.git (fetch)
# origin https://github.com/user/repo.git (push)
git remote set-url origin https://github.com/user/repo2.git
# Change the 'origin' remote's URL
git remote -v
# Verify new remote URL
@seanbuscay
seanbuscay / gist:2bd29fdb37eeb628561b
Created February 12, 2014 22:42
Do something on window resize
$(document).ready(function() {
$(window).resize(function() {
var bodyheight = $(window).height();
$("#sidebar").height(bodyheight);
});
});
$(window).bind('resize', function()
{
if($(window).width() > 500)
$('#divID').css('width', '300px');
else
$('divID').css('width', '200px');
});
First you want to start with binding the window resize event to a function of your choosing.
$(window).on("resize", methodToFixLayout);
Now you can determine the new heights and widths and make adjustments to the page from there.
function methodToFixLayout( e ) {
var winHeight = $(window).height();
var winWidth = $(window).width();
//adjust elements css etc.....
//$("#someDiv").css('someProperty',someValue based on winHeight and winWidth);
}
Without more specifics on your layout it's hard to tell what changes you'll need exactly but this should get you going in the right direction.
@seanbuscay
seanbuscay / db.sh
Created April 18, 2014 20:31
Mysql check to fix a db
mysqlcheck -op -u<user> <db>
@seanbuscay
seanbuscay / rebuild.sh
Created May 12, 2014 18:12
Rebuild system icons
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
@seanbuscay
seanbuscay / wget-example.sh
Created August 21, 2014 14:53
How to name the file output for a wget call
wget google.com -O foo.html
@seanbuscay
seanbuscay / style-attribute-removal.txt
Created August 24, 2014 22:57
Regex to remove style attributes with search and replace in most text editors.
style=".*?"