Skip to content

Instantly share code, notes, and snippets.

@coaperator
coaperator / .gitconfig
Created September 29, 2022 17:21 — forked from Kovrinic/.gitconfig
git global url insteadOf setup
# one or the other, NOT both
[url "https://github"]
insteadOf = git://github
# or
[url "git@github.com:"]
insteadOf = git://github
@coaperator
coaperator / kms
Created September 4, 2022 06:29 — forked from vikassaini01/kms
KMS server Windows
Online kms host address:
--------
kms.digiboy.ir
54.223.212.31
kms.cnlic.com
kms.chinancce.com
kms.ddns.net
franklv.ddns.net
k.zpale.com
m.zpale.com
@coaperator
coaperator / manticore.conf
Created May 27, 2022 18:31 — forked from Tkachenko-Ivan/manticore.conf
Пример конфигурационного файла Sphinx Search или Manticore Search (совместимы), для поддержки фонетических алгоритмов: Soundex, улучшенный Soundex, NYSIIS, Daitch-Mokotoff Soundex, Caverphone, Metaphone, русский Metaphone
searchd
{
listen = 9306:mysql41
listen = /var/run/mysqld/mysqld.sock:mysql41
listen = 9308:http
log = /var/log/manticore/searchd.log
query_log = /var/log/manticore/query.log
binlog_path = /var/log/manticore
pid_file = /var/run/manticore/searchd.pid
mysql_version_string = 5.0.0
@coaperator
coaperator / nginx-tuning.md
Created March 21, 2022 23:52 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@coaperator
coaperator / nuxt.config.js
Created November 2, 2021 09:37 — forked from Kolobok12309/nuxt.config.js
Nuxtjs webcache fix
export default {
...
buildModules: [
[ // 1
'@nuxtjs/router',
{
path: 'configs',
keepDefaultRouter: true,
},
],
@coaperator
coaperator / axios-catch-error.js
Created January 24, 2021 17:42 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@coaperator
coaperator / topkeywords.js
Created January 24, 2021 17:11 — forked from elliotbonneville/topkeywords.js
Find top keywords associated with a Google search with this Node.js application.
var request = require("request"),
cheerio = require("cheerio"),
url = "https://www.google.com/search?q=data+mining",
corpus = {},
totalResults = 0,
resultsDownloaded = 0;
function callback () {
resultsDownloaded++;
@coaperator
coaperator / installing-node-with-nvm.md
Created December 24, 2020 04:02 — forked from d2s/installing-node-with-nvm.md
Installing Node.js to Linux & macOS & WSL with nvm

Installing Node.js with nvm to Linux & macOS & WSL

A quick guide on how to setup Node.js development environment.

Install nvm for managing Node.js versions

nvm allows installing several versions of Node.js to the same system. Sometimes applications require a certain versions of Node.js to work. Having the flexibility of using specific versions can help.

  1. Open new Terminal window.
@coaperator
coaperator / socket-cheatsheet.js
Created June 1, 2020 06:25 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@coaperator
coaperator / gulpfile.js
Created February 1, 2019 19:29 — forked from glebcha/gulpfile.js
Gulp task sample (css and js minify+concat, compress images, watching for changes)
// Определяем зависимости в переменных
var gulp = require('gulp'),
cache = require('gulp-cache'),
clean = require('gulp-clean'),
stream = require('event-stream'),
size = require('gulp-size'),
jshint = require('gulp-jshint'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
minifyCSS = require('gulp-minify-css'),