Skip to content

Instantly share code, notes, and snippets.

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
@rolka
rolka / gist:9357529
Created March 4, 2014 22:59
jquery: latest
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
@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: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:9595980
Created March 17, 2014 08:55
jQuery: resize
$(window).resize(function() {
alert("ola");
});
@rolka
rolka / index.html
Created April 15, 2014 23:18 — forked from anonymous/index.html
centering css
<div class="container">
<div class="box">
</div>
</div>
<?php
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Sale!' :
$translated_text = __( 'Clearance!', 'woocommerce' );
$coupon_code = 'UNIQUECODE'; // Code
$amount = '10'; // Amount
$discount_type = 'fixed_cart'; // Type: fixed_cart, percent, fixed_product, percent_product
$coupon = array(
'post_title' => $coupon_code,
'post_content' => '',
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'shop_coupon'
@rolka
rolka / gist:2b92e497737422f3f739
Created May 7, 2014 07:44
jQuery: setTimeout
setTimeout( function() { jQuery("#win").hide(1000); }, 3000);
<? if ($condition): ?>
<p>Content</p>
<? elseif ($other_condition): ?>
<p>Other Content</p>
<? else: ?>
<p>Default Content</p>
<? endif; ?>