This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String toTitleCase(String str) { | |
if (str == null) { | |
return null; | |
} | |
boolean space = true; | |
StringBuilder builder = new StringBuilder(str); | |
final int len = builder.length(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$postdata = http_build_query($_POST); | |
$opts = array('http' => | |
array( | |
'method' => 'POST', | |
'header' => 'Content-type: application/x-www-form-urlencoded', | |
'content' => $postdata | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean isTimeBetweenTwoTime(String from, String to) throws ParseException { | |
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss"); | |
Date date_from = formatter.parse(from); | |
Date date_to = formatter.parse(to); | |
Calendar cal = Calendar.getInstance(); | |
String dateNow = formatter.format(cal.getTime()); | |
Date current = formatter.parse(dateNow); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Function to display custom field in Admin Profile editor | |
* Only Admin can view these options | |
*/ | |
function user_custom_fields($user) { | |
if (is_admin()) { // Check of admin | |
$is_verified = get_the_author_meta('is_verified', $user->ID); | |
$is_qualified = get_the_author_meta('is_qualified', $user->ID); | |
?> <table class="form-table"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var home = { | |
room_1: { | |
tube: 5, | |
fan: 6, | |
lamp: { | |
one: 7, | |
two: { | |
two_1: 8, | |
tow_two: 9 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class TimezoneSelectHelper extends FormHelper | |
{ | |
var $helpers = array('Form'); | |
function select($fieldname, $label, $default="Asia/Calcutta", $attributes=false) | |
{ | |
$list = '<div class="input">'; | |
$list .= $this->Form->label($label); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class GravatarHelper extends AppHelper { | |
/** | |
* Get either a Gravatar URL or complete image tag for a specified email address. | |
* | |
* @param string $email The email address | |
* @param string $s Size in pixels, defaults to 80px [ 1 - 2048 ] | |
* @param boole $img True to return a complete IMG tag False for just the URL |