Steps to deploy Node.js to VPS using PM2 and Github Actions
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
lst = [ | |
{"current_time":1618861512,"success":True,"data":[{"id":590,"company":{"name":"افسران جنگ نرم","name_en":"Afsaran","company_slug":"afsaran","logo":"/company/afsaran/9f7d4c70-403a-11e9-ae0e-273fe94d6d59.png"},"job":{"job_slug":"full-stack","name":"Full Stack"},"title":"شرکت افسران جنگ نرم درخواست رسمی خود را مبنی بر عدم به اشتراک گذاری این اطلاعات بر روی پلتفرم جابگای ابلاغ کرده و به این منظور جابگای مجبور به حذف این اطلاعات میباشد.","description":"شرکت افسران جنگ نرم درخواست رسمی خود را مبنی بر عدم به اشتراک گذاری این اطلاعات بر روی پلتفرم جابگای ابلاغ کرده و به این منظور جابگای مجبور به حذف این اطلاعات میباشد.","vote_count":0,"down_vote_count":2,"vote_state":"NONE","view_count":61,"over_all_rate":0,"created":"2020-06-10 18:37","my_review":False,"state":"FULL","approved":True,"has_legal_issue":True}],"message":None,"total":1,"show_type":"TOAST","index":0}, | |
{"current_time":1618861554,"success":True,"data":[{"id":60,"company":{"name":"آپاسای داده سیستم","name_en":"Apasai Dade System","company_sl |
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 mongoengine import connect, Document, EmbeddedDocument, \ | |
ReferenceField, EmbeddedDocumentListField, StringField, ObjectIdField | |
connect() # Connect to `test` database by default | |
###### | |
# Option1: Using 2 different collections for users and tickets | |
###### | |
class User(Document): | |
name = StringField() |
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
export default [ | |
{ name: 'Afghanistan', code: 'AF', name_fa: 'افغانستان' }, | |
{ name: 'land Islands', code: 'AX', name_fa: 'جزایر الند' }, | |
{ name: 'Albania', code: 'AL', name_fa: 'آلبانی' }, | |
{ name: 'Algeria', code: 'DZ', name_fa: 'الجزایر' }, | |
{ name: 'American Samoa', code: 'AS', name_fa: 'ساموآی آمریکا' }, | |
{ name: 'AndorrA', code: 'AD', name_fa: 'آندورا' }, | |
{ name: 'Angola', code: 'AO', name_fa: 'آنگولا' }, | |
{ name: 'Anguilla', code: 'AI', name_fa: 'آنگویلا' }, | |
{ name: 'Antigua and Barbuda', code: 'AG', name_fa: 'آنتیگوآ و باربودا' }, |
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
/** | |
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken | |
* It was requested to be introduced at as part of the jsonwebtoken library, | |
* since we feel it does not add too much value but it will add code to mantain | |
* we won't include it. | |
* | |
* I create this gist just to help those who want to auto-refresh JWTs. | |
*/ | |
const jwt = require('jsonwebtoken'); |
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
http://apassant.net/2012/01/16/timeout-for-html5-localstorage/ | |
var hours = 24; // Reset when storage is more than 24hours | |
var now = new Date().getTime(); | |
var setupTime = localStorage.getItem('setupTime'); | |
if (setupTime == null) { | |
localStorage.setItem('setupTime', now) | |
} else { | |
if(now-setupTime > hours*60*60*1000) { | |
localStorage.clear() |
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
[ | |
"Afghan", | |
"Albanian", | |
"Algerian", | |
"American", | |
"Andorran", | |
"Angolan", | |
"Antiguans", | |
"Argentinean", | |
"Armenian", |
NewerOlder