Skip to content

Instantly share code, notes, and snippets.

View Unzeabk's full-sized avatar
🎯
Focusing

Zeabokun Unzeabk

🎯
Focusing
View GitHub Profile
@tkon99
tkon99 / name.js
Last active April 19, 2024 14:38
Random Name Generator for Javascript
/*
(c) by Thomas Konings
Random Name Generator for Javascript
*/
function capFirst(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
function getRandomInt(min, max) {
@mreschke
mreschke / nginx.conf
Last active May 14, 2024 14:54
Nginx config for multiple laravel sites based on /api/v1 url paths
# This config will host your main [Laravel] GUI application at /, and any additional [Lumen] webservices at /api/v1 and /api/v2...
# This also works perfectly for all static file content in all projects
# This is full of debug comments so you can see how to print debug output to browser! Took me hours to nail this perfect config.
# Example:
# http://example.com - Main Laravel site as usual
# http://example.com/about - Main Laravel site about page as usual
# http://example.com/robots.txt - Main Laravel site static content as usual
# http://example.com/api/v1 - Lumen v1 api default / route
# http://example.com/api/v1/ - Lumen v1 api default / route
@tomasevich
tomasevich / nginx_nodejs.md
Last active June 22, 2024 19:20
Сервер в связке Nginx + NodeJs

Сервер в связке Nginx + NodeJs

Данная пошаговая инструкция поможет освоить основы на простом примере

Для справки

Сервер поднимался на Debian 8 c характеристиками:

CPU - 1 ядро x 500 МГц

@mccabiles
mccabiles / nginx.conf
Created September 17, 2019 11:24
Using gzip with Nginx and Vue CLI project
...
gzip on;
gzip_static on;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_proxied any;
gzip_vary on;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
@flutterfirebase
flutterfirebase / A Nuxt.js VPS production deployment.md
Created July 30, 2020 02:38 — forked from DreaMinder/A Nuxt.js VPS production deployment.md
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 nuxt@2.3. For older versions deployment, see revision history.


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

@datfridman
datfridman / googleadstg.js
Created January 13, 2021 00:31
Google Ads Script - Telegram Stats
function main(){
var currentAccount = AdsApp.currentAccount();
var todayCost = AdsApp.currentAccount().getStatsFor("TODAY").getCost(); // Затраты сегодня
var yesterdayCost = AdsApp.currentAccount().getStatsFor("YESTERDAY").getCost(); // Затраты вчера
var todayClicks = currentAccount.getStatsFor("TODAY").getClicks(); // Клики сегодня
var yesterdayClicks = currentAccount.getStatsFor("YESTERDAY").getClicks(); // Клики вчера
var monthCost = AdsApp.currentAccount().getStatsFor("THIS_MONTH").getCost(); // Затраты за этот месяц
var pastmonthCost = AdsApp.currentAccount().getStatsFor("LAST_MONTH").getCost(); // Затраты за предыдущий месяц
var todayCpc = currentAccount.getStatsFor("TODAY").getAverageCpc(); // Цена за клик сегодня
var todayImpressions = currentAccount.getStatsFor("TODAY").getImpressions(); // Кол-во показов сегодня
@KtanPatel
KtanPatel / production-nodejs-mongodb-server-setup-ubuntu-20.04.sh
Last active May 4, 2024 05:53
Setup Node.js + MongoDB + PM2 Production Server on Ubuntu 20.04
#!/usr/bin/env bash
echo "
----------------------
NODE & NPM
----------------------
"
# add nodejs LTS ppa (personal package archive) from nodesource
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
const pw = require('playwright');
const UserAgent = require('user-agents');
const uuid = require('uuid');
const tmp = require('tmp-promise');
const UINT32_MAX = (2 ** 32) - 1;
const WEBGL_RENDERERS = ['ANGLE (NVIDIA Quadro 2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (NVIDIA Quadro K420 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro 2000M Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro K2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (ATI Radeon HD 3800 Series Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (AMD Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D