Skip to content

Instantly share code, notes, and snippets.

<?php
class Licence
{
private $username = "USERNAME";
private $api_key = "API_KEY";
private $product_id;
private $purchase_code;
public function product_id($product_id = null)
<?php
/*
| __________________________________________________________________
| CODEIGNITER UNZIP LIBRARY
| __________________________________________________________________
| developed by Md. Shohrab Hossain
| email <sourav.diubd@gmail.com>
| __________________________________________________________________
| HOW TO USE
| An example is given below
<?php
/*
* Detect Where the Script is Running (Suffix = S for Server/ L for Local)
* ID generated by microtime()
*/
class Generate
{
private $ip = array('127.0.0.1', '::1', 'localhost');
<?php
function checkPasswordStrength($password, $grade = 3, $info = NULL, $file = NULL, $ci = true){
if ( empty($password) ){
return false;
}
$grade = intval($grade);
if ( $grade < 1 ){
return false;
}
$info = empty($info) ? NULL : $info;
<div class="col-sm-4">
<div class="form-group">
<label class="col-sm-3 control-label" for="year"> Year </label>
<div class="col-sm-9">
<input type="text" name="year" id="year" class="form-control currentYearPicker" value="2018" placeholder="Year" data-validation="required" autocomplete="off" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="month"> Month </label>
@souravmsh
souravmsh / SQL – left join on first or last record in the right table
Last active December 22, 2018 09:06
SQL – left join on first or last record in the right table
SELECT s1.hr_shift_id, u.hr_unit_name
FROM hr_shift s1
LEFT JOIN hr_shift s2
ON (s1.hr_shift_name = s2.hr_shift_name AND s1.hr_shift_id < s2.hr_shift_id)
LEFT JOIN hr_unit AS u
ON u.hr_unit_id = s1.hr_shift_unit_id
WHERE s2.hr_shift_id IS NULL
<?php
$text = "The quick brown fox jumps over the lazy dog!";
$text = strtolower($text);
$characters = array('a'=>0,'b'=>0,'c'=>0,'d'=>0,'e'=>0,'f'=>0,'g'=>0,'h'=>0,'i'=>0,'j'=>0,'k'=>0,'l'=>0,'m'=>0,'n'=>0,'o'=>0,'p'=>0,'q'=>0,'r'=>0,'s'=>0,'t'=>0,'u'=>0,'v'=>0,'w'=>0,'x'=>0, 'y'=>0,'z'=>0);
if ($text != " " && strlen($text) <= 200)
{
for ($i=0; $i<strlen($text); $i++)
{
if (in_array($text[$i], $characters)){
<?php
$count = array(0=>0,1=>0,2=>0,3=>0,4=>0);
$inputs = array(
0 => '00001',
1 => '00011',
2 => '01110',
3 => '00110',
4 => '00000'
);
$('#checkAll').click(function(){
var checked =$(this).prop('checked');
$('input:checkbox').prop('checked', checked);
});
$('body').on('click', 'input:checkbox', function() {
if(!this.checked) {
$('#checkAll').prop('checked', false);
}
else {
var numChecked = $('input:checkbox:checked:not(#checkAll)').length;
$root=(isset($_SERVER["HTTPS"]) ? "https://" : "http://").$_SERVER["HTTP_HOST"];
$root.= str_replace(basename($_SERVER["SCRIPT_NAME"]), "", $_SERVER["SCRIPT_NAME"]);
$config["base_url"] = $root;