Skip to content

Instantly share code, notes, and snippets.

@digitup
digitup / git Website workflow 2.sh
Created August 27, 2012 19:36
Git: website workflow 2
To update the website is simply a matter of pushing my local development branch to the website repository...
git push origin dev
...and then, merge the changes into the live website tree. I need to SSH log in to the website server, and run the following command at the website folder:
git merge dev
This will bring the pushed changes, at "dev" branch, to the "master" branch (which is the live site current branch).
* IMPROVING THE UPDATE PROCESS *
@digitup
digitup / Server - Nginx 502 bad gateway.sh
Created August 29, 2012 06:13
Server: Nginx 502 bad gateway
Add to nginx config file located at /etc/nginx/nginx.conf in the hrml section:
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
@digitup
digitup / gist:3523613
Created August 30, 2012 07:10 — forked from alkos333/gist:1771618
jQuery: Get URL Parameters
// Given a query string "?to=email&why=because&first=John&Last=smith"
// getUrlVar("to") will return "email"
// getUrlVar("last") will return "smith"
// Slightly more concise and improved version based on http://www.jquery4u.com/snippets/url-parameters-jquery/
function getUrlVar(key){
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search);
return result && unescape(result[1]) || "";
}
@digitup
digitup / Chrome console Solarized Dark theme
Created October 5, 2012 09:14 — forked from anonymous/gist:1258555
Solarized Dark Theme (with sidebar and view-source colors) for Google Chrome Dev Tools
/**********************************************/
/*
/* Solarized Dark Skin by Mark Osborne - 2011
/*
/* Based on IR_Black Skin by Ben Truyman:
/* https://gist.github.com/1245727
/*
/* and Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
@digitup
digitup / Custom.css
Created October 5, 2012 09:18 — forked from bentruyman/Custom.css
IR_Black Theme for Chrome Developer Tools
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@digitup
digitup / jQuery: Extend search box width.html
Created October 12, 2012 09:37
jQuery: Extend search box width
<html><body>
<style>
#search {
background-color: #999;
width: 100px;
border: 1px solid #ddd;
outline: none;
}
</style>
@digitup
digitup / add.active.class.js
Created November 2, 2012 10:25
jQuery - add an active class to the current URL
var url = document.URL;
$('#menu a[href="'+url+'"]').addClass('active');
@digitup
digitup / jQuery.fixed.menu.after.scroll.js
Created November 3, 2012 19:35
jQuery - Fixed menu after scrolling
$(window).scroll(function () {
if (!docked && (menu.offsetTop - scrollTop() < 0)) {
menu.style.top = 0;
menu.style.position = 'fixed';
menu.className = 'docked';
docked = true;
} else if (docked && scrollTop() <= init) {
menu.style.position = 'absolute';
menu.style.top = init + 'px';
menu.className = menu.className.replace('docked', '');
@digitup
digitup / jQuery.fix.element.pos.after.scroll.js
Created November 3, 2012 19:40
jQuery - Fix Element Position After Some Scroll Using jQuery
(function($){
$.fn.scrollFixed = function(params){
params = $.extend( {appearAfterDiv: 0, hideBeforeDiv: 0}, params);
var element = $(this);
if(params.appearAfterDiv)
var distanceTop = element.offset().top + $(params.appearAfterDiv).outerHeight(true) + element.outerHeight(true);
else
var distanceTop = element.offset().top;
@digitup
digitup / Fetch.sublime-settings
Created November 7, 2012 16:16 — forked from dustinhorton/Fetch.sublime-settings
Sublime - fetch settings for sublime text 2
{
"files":
{
"jquery" : "http://code.jquery.com/jquery.min.js",
"jquery-ui-effects" : "https://raw.github.com/jquery/jquery-ui/master/ui/jquery.effects.core.js",
"jquery-mobile-vmouse" : "https://raw.github.com/jquery/jquery-mobile/master/js/jquery.mobile.vmouse.js",
"jquery-flexslider" : "https://raw.github.com/mbmufffin/FlexSlider/master/jquery.flexslider-min.js",
"jquery-mediaelement" : "https://raw.github.com/johndyer/mediaelement/master/build/mediaelement-and-player.js",
"jquery-url" : "https://raw.github.com/allmarkedup/jQuery-URL-Parser/master/jquery.url.js",
"jquery-dotimeout" : "https://raw.github.com/cowboy/jquery-dotimeout/master/jquery.ba-dotimeout.min.js",