Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| /** | |
| * Developed by @mkhizeryounas | |
| * How to use | |
| * --- Example --- | |
| const music = new Patari(); | |
| music.getHomeContent().then(res => { | |
| music.playSong(res.songs[3].itemID); | |
| // music.getSongInfo(res.songs[0].itemID).then(res2 => { | |
| // console.log("getSongInfo", res2); | |
| // }); |
This file contains hidden or 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 combs(num) { | |
| let str = num.toString().split(""); | |
| let toRes = []; | |
| var tmp = str; | |
| for (i of str) { | |
| let val = parseInt(tmp.join("")); | |
| if (!toRes.includes(val)) toRes.push(val); | |
| let t = tmp.shift(); | |
| tmp.push(t); | |
| } |
This file contains hidden or 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 HttpStatus = require("http-status-codes"); | |
| module.exports = function(req, res, next) { | |
| res.result = responseJson => { | |
| let data = | |
| typeof responseJson.data === "undefined" ? {} : responseJson.data; | |
| let statusCode = | |
| typeof responseJson.statusCode === "undefined" | |
| ? 200 | |
| : responseJson.statusCode; | |
| let message = |
This file contains hidden or 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 disabledArr = ["01/08/2018"]; | |
| $("#kk").daterangepicker({ | |
| isInvalidDate: function(arg){ | |
| console.log(arg); | |
| // Prepare the date comparision | |
| var thisMonth = arg._d.getMonth()+1; // Months are 0 based | |
| if (thisMonth<10){ |
This file contains hidden or 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 set_mapping(key, value, obj) { | |
| function mapper(keys, value, obj = {}) { | |
| let keyName = keys.shift(); | |
| if (keys.length == 0) { | |
| obj[keyName] = value; | |
| } else { | |
| obj[keyName] = mapper(keys, value, obj[keyName]); | |
| } | |
| return obj; | |
| } |
This file contains hidden or 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
| const bcrypt = require("bcryptjs"); | |
| module.exports = { | |
| attributes: { | |
| name: { type: "String", required: true }, | |
| email: { type: "String", unique: true, required: true }, | |
| password: { type: "String", required: true }, | |
| phone: { type: "String", required: true } | |
| }, | |
| beforeCreate: (user, next) => { |
This file contains hidden or 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
| /** | |
| * Author: @mkhizeryounas | |
| * @array : 1-D Array | |
| * @rules : | |
| * { | |
| * "filter" : [ | |
| * { | |
| * "key" : "product_id", | |
| * "value" : "10593", | |
| * "op" : "<" |
This file contains hidden or 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
| /****** bin/www ******/ | |
| // After -> server.listen(port); | |
| // Addd the following for Socket.IO | |
| var io = require('socket.io').listen(server); | |
| require('../custom_modules/socket-helper')(io); | |
| /****** socket-helper.js module ******/ | |
| module.exports = function (io) { | |
| io.on('connection', function(socket){ |
This file contains hidden or 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
| /** | |
| -- HOW TO USE -- | |
| let data = { | |
| user: "Khizer", | |
| company: "Shopdesk", | |
| showName: "Eid", | |
| money: { | |
| amount: 1000, | |
| currency : "PKR", | |
| some: { |