Skip to content

Instantly share code, notes, and snippets.

View ghonchesefidi's full-sized avatar

Mohammad Ghonchesefidi ghonchesefidi

View GitHub Profile
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
@danielwetan
danielwetan / nodejs-cicd-github-actions.md
Last active July 22, 2024 15:13
Deploy Node.js to VPS using Github Actions

Deploy Node.js to VPS using Github Actions

Steps to deploy Node.js to VPS using PM2 and Github Actions

1. Clone repo to VPS folder

@WesThorburn
WesThorburn / instructions.md
Last active December 25, 2023 12:05
Use Chart.js with Nuxt v2.11.0

Use Chart.js with Nuxt v2.11.0

Line chart example

  • Run npm i vue-chartjs
  • Run npm i chart.js hchs-vue-charts
  • Create a file called chart.js and save it in the /plugins directory
  • Give chart.js the following contents
import Vue from 'vue'
import { Line } from 'vue-chartjs'
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()
@themojilla
themojilla / countries.js
Last active April 17, 2024 11:33
لیست کامل کشورهای جهان - json
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: 'آنتیگوآ و باربودا' },
@bradtraversy
bradtraversy / docker-help.md
Last active July 9, 2024 10:18
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@ziluvatar
ziluvatar / token-generator.js
Last active July 16, 2024 14:46
Example of refreshing tokens with jwt
/**
* 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');
@shaik2many
shaik2many / javascript-localstorage-expiry.js
Created July 20, 2016 14:07
set timeout for localStorage or sessionStorage
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()
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active July 14, 2024 19:55
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

[
"Afghan",
"Albanian",
"Algerian",
"American",
"Andorran",
"Angolan",
"Antiguans",
"Argentinean",
"Armenian",