Skip to content

Instantly share code, notes, and snippets.

View Lardpower's full-sized avatar

Alexander (Sasha) Reznikov Lardpower

View GitHub Profile
@TheVaan
TheVaan / teamspeak3-server
Last active April 27, 2024 10:58
UFW application file for TS3 Server
[TeamSpeak3]
title=TeamSpeak3
description=TeamSpeak3 Server
ports=9987/udp|10011,30033/tcp
@Ekultek
Ekultek / ufw-denier.sh
Created August 9, 2018 21:27
A script to download bad IP addresses and deny them with UFW
#!/bin/bash
TMP_DIR="/tmp"
URL_LINKS=$"http://www.blocklist.de/lists/ssh.txt
http://www.blocklist.de/lists/apache.txt
http://www.blocklist.de/lists/asterisk.txt
http://www.blocklist.de/lists/bots.txt
http://www.blocklist.de/lists/courierimap.txt
http://www.blocklist.de/lists/courierpop3.txt
http://www.blocklist.de/lists/email.txt
// On PhpStorm, when ussing with laravel mix, for Alias path resolving in components you have to:
// - create a webpack.config.js file separately like:
const path = require('path')
const webpack = require('webpack')
module.exports = {
...
resolve: {
extensions: ['.js', '.json', '.vue'],
@javilobo8
javilobo8 / download-file.js
Last active May 27, 2024 21:00
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@webprogramozo
webprogramozo / blur-bs3-bs4.css
Last active May 16, 2024 13:32
Bootstrap modal with blurry background (Bootstrap 3,4,5)
/* Compatible with Bootstrap 3 and 4 */
body.modal-open > :not(.modal) {
-webkit-filter: blur(1px);
-moz-filter: blur(1px);
-o-filter: blur(1px);
-ms-filter: blur(1px);
filter: blur(1px);
}
@dimmduh
dimmduh / Nginx-1.7_vhost.conf
Last active November 15, 2023 17:09
Example nginx config for Yii 2 (advanced) for openserver
server {
listen %ip%:%httpport%;
listen %ip%:%httpsport% ssl;
server_name %host% %aliases%;
# if ($request_method !~* ^(GET|HEAD|POST)$ ){return 403;}
location ~ /\. {deny all;}
location / {
@branneman
branneman / better-nodejs-require-paths.md
Last active June 29, 2024 16:00
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions