Skip to content

Instantly share code, notes, and snippets.

@rolka
rolka / gist:6186126
Created August 8, 2013 16:21
wp: echo site_url();
<?php echo site_url(); ?>
@rolka
rolka / gist:6186397
Created August 8, 2013 16:49
wp: bloginfo('charset');
<?php bloginfo('charset'); ?>
@rolka
rolka / gist:6321627
Created August 23, 2013 17:02
css: font-face
@font-face {
font-family: 'yanone_kaffeesatzlight';
src: url('yanonekaffeesatz-light-webfont.eot');
src: url('yanonekaffeesatz-light-webfont.eot?#iefix') format('embedded-opentype'),
url('yanonekaffeesatz-light-webfont.woff') format('woff'),
url('yanonekaffeesatz-light-webfont.ttf') format('truetype'),
url('yanonekaffeesatz-light-webfont.svg#yanone_kaffeesatzlight') format('svg');
font-weight: normal;
font-style: normal;
@rolka
rolka / gist:6322152
Created August 23, 2013 17:57
jquery: open link in new tab
$(".modal a").attr("target","_blank");
@rolka
rolka / gist:6412300
Created September 2, 2013 12:21
wp: home url
<?php echo esc_url( home_url( '/' ) ); ?>
@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');
}
@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: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: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
{
"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,