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 product_Name_id = $j('#product_Name_1 option:selected').attr("id"); | |
var product_Name = $j('#product_Name_1 option:selected').text(); |
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
$('input:checkbox').prop('checked', false); | |
$("input[name=type]:checked").val() |
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
$from = $_GET['from'] . '-01'; | |
$to = $_GET['to']; | |
$date = date_create_from_format('Y-m', $to); | |
$to = $to . '-' . cal_days_in_month(CAL_GREGORIAN, $date->format('m'), $date->format('Y')); |
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 | |
error_reporting(~E_NOTICE); | |
set_time_limit(0); | |
$address = "192.168.1.60"; | |
$port = 5000; | |
$max_clients = 10; | |
if (!($sock = socket_create(AF_INET, SOCK_STREAM, 0))) { |
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 or Javascript |
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 | |
function currency_convert($from,$to,$amount) { | |
$string = "1".$from."=?".$to; | |
$google_url = "http://www.google.com/ig/calculator?hl=en&q=".$string; | |
$result = file_get_contents($google_url); | |
$result = explode('"', $result); | |
$converted_amount = explode(' ', $result[3]); | |
$conversion = $converted_amount[0]; | |
$conversion = $conversion * $amount; | |
$conversion = round($conversion, 2); |
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 | |
/** | |
* @author Waruna Oshan Wisumperuma | |
* @contact warunaoshan@gmail.com | |
* | |
* https://gist.github.com/oshanz/97782c79ac186c5f6e59 | |
* Semantic version = 1.0.0 | |
* | |
* This program is free software: you can redistribute it and/or modify |
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 worker = new Worker(URL + "view/gmapsRoute/js/observer.js"); | |
worker.postMessage("sdfdf"); | |
worker.onmessage = function(event) { | |
alert("Received message " + event.data); | |
worker.terminate(); | |
}; | |
************************************************************************************* |
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 loadOrdered(files, callback) { | |
$.getScript(files.shift(), function() { | |
files.length | |
? loadOrdered(files, callback) | |
: callback(); | |
}); | |
} | |
edit, a nicer version: | |
function loadOrdered(files, callback) { |
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($){ | |
$.fn.jExpand = function(){ | |
var element = this; | |
$(element).find("tr:odd").addClass("odd"); | |
$(element).find("tr:not(.odd)").hide(); | |
$(element).find("tr:first-child").show(); | |
$(element).find("tr.odd").click(function() { | |
$(this).next("tr").toggle(); |