Skip to content

Instantly share code, notes, and snippets.

View tranghaviet's full-sized avatar

Ha Viet Trang tranghaviet

View GitHub Profile
@Brandawg93
Brandawg93 / google_login.ts
Last active June 25, 2024 05:15
Login to Google Account via Puppeteer
import puppeteer from 'puppeteer-extra';
import pluginStealth from 'puppeteer-extra-plugin-stealth'; // Use v2.4.5 instead of latest
import * as readline from 'readline';
puppeteer.use(pluginStealth());
// Use '-h' arg for headful login.
const headless = !process.argv.includes('-h');
// Prompt user for email and password.
<?php declare(strict_types=1);
namespace App\Models\Relations;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Jenssegers\Mongodb\Relations\BelongsToMany;
/**
@stawidy
stawidy / speedtest-server-list.txt
Created December 27, 2018 04:44
Speedtest 节点列表
17584) Chongqing Mobile Company (Chongqing, CN)
5726) China Unicom Chong Qing Branch (Chongqing, China)
5530) CCN (Chongqing, China)
19076) China Telecom (ChongQing, China)
20054) YunJinTianFu (Chengdu, China)
11444) University of Electronic Science and Technology of China (Chengdu, China)
2461) China Unicom (Chengdu, China)
4575) China Mobile Group Sichuan (Chengdu, China)
16398) China Mobile,GuiZhou (Guiyang, China)
5292) China Mobile Group Shaanxi Company Limited (Xi'an, China)
@hoangmirs
hoangmirs / deploy-pm2.md
Last active October 16, 2024 23:51
Deploy pm2 guide

1. Preparing the server

Install git

sudo apt install git-all

Generate Server's SSH public key

ssh-keygen -t rsa -b 4096 -C "deploy"
cat ~/.ssh/id_rsa.pub
@DreaMinder
DreaMinder / A Nuxt.js VPS production deployment.md
Last active July 31, 2024 13:56
Deployment manual for a real-world project built with nuxt.js + koa + nginx + pm2

Example of deployment process which I use in my Nuxt.js projects. I usually have 3 components running per project: admin-panel SPA, nuxt.js renderer and JSON API.

This manual is relevant for VPS such as DigitalOcean.com or Vultr.com. It's easier to use things like Now for deployment but for most cases VPS gives more flexebillity needed for projects bigger than a landing page.

UPD: This manual now compatible with [email protected]. For older versions deployment, see revision history.


Let's assume that you have entered fresh installation of Ubuntu instance via SSH. Let's rock:

@johngrimes
johngrimes / nginx.conf
Created February 14, 2018 22:23
Ideal Nginx configuration for JavaScript single-page app
server {
listen 80;
root /usr/share/nginx/html;
gzip on;
gzip_types text/css application/javascript application/json image/svg+xml;
gzip_comp_level 9;
etag on;
location / {
try_files $uri $uri/ /index.html;
}
@kerryboyko
kerryboyko / README.md
Last active April 26, 2023 16:08
VueJS Best Practices Guide

Deverus Vue.js Style Guide

Guide for developing Vue.js applications.

v. 0.0.1

Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.

However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.

@cfebs
cfebs / guide.md
Last active February 16, 2022 19:49
Ubuntu guest virtualbox on Windows 10 host with ssh port forwarding

If you want:

  • a Linux guest runnning on a Windows host
  • the ability to ssh to the guest from the Windows host
  • the ability to ssh to the guest from another machine on your home network

About 90% of this comes from: https://gist.github.com/pjdietz/5768124 just with a few fixes for the host only network

Setup

1 Create a host only network in the Virtualbox GUI

@sadikaya
sadikaya / git-bash-in-webstorm.md
Last active September 23, 2024 17:50
git bash inside Webstorm terminal

Go to File -> Settings -> Tools -> Terminal and change Shell path based on the the installed git version.

for 64bit:

"C:\Program Files\Git\bin\sh.exe" --login -i

for 32bit:

"C:\Program Files (x86)\Git\bin\sh.exe" --login -i
Map
.find({
artistId: Utils.convertToObjectId(user._id)
})
.select("nameUrl status mapType created sliders")
.populate({
path: 'sliders',
select: 'name No createdAt works',
populate: [{
path: 'works',