Skip to content

Instantly share code, notes, and snippets.

@rolka
rolka / gist:9407277
Created March 7, 2014 07:56
Git: push new local branch to remote
git push -u origin newLocalBranch
@rolka
rolka / gist:9386697
Created March 6, 2014 10:12
jQuery: parse int
var sVal = '23 45 68';
var iNum = parseInt(sVal); //Output will be 23.
@rolka
rolka / gist:9365759
Created March 5, 2014 11:49
GIT: change editor
export GIT_EDITOR=vim
export VISUAL=vim
export EDITOR=vim
@rolka
rolka / gist:9357529
Created March 4, 2014 22:59
jquery: latest
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
http://www.refulz.com:8082/index.php#tab2?foo=789
Property Result
-------------------------------------------
host www.refulz.com:8082
hostname www.refulz.com
port 8082
protocol http
pathname index.php
href http://www.refulz.com:8082/index.php#tab2
{
"color_scheme": "Packages/User/textmate-solarized/Solarized (Dark).tmTheme",
"default_line_ending": "unix",
"dictionary": "Packages/Language - English/en_GB.dic",
"draw_white_space": "selection",
"find_selected_text": true,
"font_face": "menlo",
"font_size": 12,
"highlight_line": true,
@rolka
rolka / gist:8282560
Created January 6, 2014 12:59
Git: global alias
$ git config --global alias.co checkout
$ git config --global alias.br branch
$ git config --global alias.ci commit
$ git config --global alias.st status
@rolka
rolka / gist:8280654
Created January 6, 2014 10:04
jQuery: detect iPad
if(navigator.userAgent.match(/iPad/i)) {
viewport = document.querySelector("meta[name=viewport]");
viewport.setAttribute('content', 'width=380px');
}
@rolka
rolka / gist:6939489
Created October 11, 2013 18:14
GIT: create git alias
$ git config --global alias.st status
$ git config --global alias.ci 'commit -v'
@rolka
rolka / gist:6448454
Created September 5, 2013 10:28
wp: include latest jQuery in WP
if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
function my_jquery_enqueue() {
wp_deregister_script('jquery');
wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://code.jquery.com/jquery-2.0.3.min.js", false, null);
wp_enqueue_script('jquery');
}