Skip to content

Instantly share code, notes, and snippets.

View Faizanq's full-sized avatar

Faizan Qureshi Faizanq

View GitHub Profile
$query->andWhere(['>=','date(i_date)',date("Y-m-d")]);
$query->andWhere(['<=','date(i_date)',date("Y-m-d")]);
$('#mySelect2')
.empty() //empty select
.append($("<option/>") //add option tag in select
.val("20") //set value for option to post it
.text("nabi")) //set a text for show in select
.val("20") //select option of select2
.trigger("change"); //apply to select2
$("#mySelect2").val("{{ids}}").trigger('change');
var values="Test,Prof,Off";
$.each(values.split(","), function(i,e){
$("#strings option[value='" + e + "']").prop("selected", true);
});
app.get('/*', function(req,res,next) {
req.session.flash = [];
next();
});
hooks : {
beforeCreate : (record, options) => {
record.dataValues.createdAt = Math.floor(Date.now() / 1000);
record.dataValues.updatedAt = Math.floor(Date.now() / 1000);
},
beforeUpdate : (record, options) => {
record.dataValues.updatedAt = Math.floor(Date.now() / 1000);
}
}
@Faizanq
Faizanq / app.js
Created November 15, 2018 13:18 — forked from narirou/app.js
express.js + pjax workflow
var express = require( 'express' ),
bodyParser = require( 'body-parser' ),
pjax = require( './pjax-helper' );
var app = express();
app.set( 'views', __dirname + '/views' );
app.set( 'view engine', 'jade' );
app.use( pjax() );
@Faizanq
Faizanq / Indian States and Cities list in php
Last active March 7, 2023 07:19
Indian States and Cities array list in php
<?php
return [
'Andhra Pradesh (AP)'=>[
'Adilabad',
'Anantapur',
'Chittoor',
'Kakinada',
'Guntur',
https://github.com/topics/laravel-admin-panel
curl -O https://getcomposer.org/composer.phar
mv composer.phar composer
chmod +x composer
sudo mv composer /usr/local/bin
composer