Skip to content

Instantly share code, notes, and snippets.

View fadlee's full-sized avatar

Fadlul Alim fadlee

  • Indonesia
  • 11:21 (UTC +07:00)
View GitHub Profile
@fadlee
fadlee / helpers.js
Created June 30, 2013 13:31
Javascript Functions
//How can I get query string values?
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
function setCookie(c_name,value,exdays)
{
@fadlee
fadlee / image-shortcode.php
Created April 11, 2012 12:08 — forked from kovshenin/image-shortcode.php
Image shortcode for WordPress
<?php
/**
* Image shortcode callback
*
* Enables the [kovshenin_image] shortcode, pseudo-TimThumb but creates resized and cropped image files
* from existing media library entries. Usage:
* [kovshenin_image src="http://example.org/wp-content/uploads/2012/03/image.png" width="100" height="100"]
*
* @uses image_make_intermediate_size
*/