Skip to content

Instantly share code, notes, and snippets.

View Nekaravaev's full-sized avatar
🥽

Andrey Nekaravaev

🥽
  • Everywhere
View GitHub Profile
@Bo0oM
Bo0oM / laravel_session.php
Created May 15, 2020 08:01
Laravel Encryptor
<?php
class LaravelEncryptor {
private $key;
private $cipher;
public function __construct($key = 'ABCDEF1234567890ABCDEF1234567890', $cipher = 'AES-256-CBC') {
$this->key = substr($key, 0, 7) == 'base64:' ? base64_decode(substr($key, 7)) : $key;
$this->cipher = $cipher;
}
@iamakulov
iamakulov / index.md
Last active February 17, 2024 03:32
What you should (and shouldn’t) enable in Cloudflare for web performance

What you should (and shouldn’t) enable in Cloudflare for web performance

Cloudflare is a web-performance-and-security-as-a-service company.

To configure your web app to run faster, you need to:

  • sign up for Cloudflare
  • connect it to your site (by moving DNS records and setting up proxying)
  • enable a few toggles in the settings.
@mutin-sa
mutin-sa / Top_Public_Recursive_Name_Servers.md
Last active April 27, 2024 14:59
List of Top Public Recursive Name Servers

DNS:

IPv4 Addr IPv6 Addr ASn Political Region Loc Svc Org
8.8.8.8 2001:4860:4860::8888 AS15169 US Worldwide (Anycast) Google Public DNS Google
8.8.4.4 2001:4860:4860::8844 AS15169 US Worldwide (Anycast) Google Public DNS Google
1.1.1.1 2606:4700:4700::1111 AS13335 US Worldwide (Anycast) Cloudflare-DNS Cloudflare/APNIC
1.0.0.1 2606:4700:4700::1001 AS13335 US Worldwide (Anycast) Cloudflare-DNS Cloudflare/APNIC
208.67.222.222 2620:119:35::35 AS36692 US *W
@holmberd
holmberd / php-pools.md
Last active April 19, 2024 07:24
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@tanaikech
tanaikech / submit.md
Last active December 27, 2022 09:26
Enhanced onEdit(e) using Google Apps Script

Enhanced onEdit(e) using Google Apps Script

onEdit(e) which is used for the Edit event on Spreadsheet has the old value as e.oldValue. The specifications for this are as follows.

  1. When an user edited a single "A1" cell, e of onEdit(e) shows hoge for e.oldValue and fuga for e.value.
  2. When an user edited the "A1:A2" multiple cells, e.oldValue and e.value of onEdit(e) are not shown anything.
  3. When an user copied and pasted from other cell, e.oldValue and e.value of onEdit(e) are not shown anything.

This sample script was created to retrieve both the edited values and the old values for the range of edited cells. This is the modified e.oldValue.

@akella
akella / setup.md
Last active February 21, 2023 22:59
Мой сетап

То что я использую в работе и стримах

Софт для разработки

anonymous
anonymous / trello.sh
Created September 22, 2016 18:41
swap out KEY and TOKEN and any lists from your own boards you would like to use and put this in your /usr/local/bin or anything in your $PATH variable (for instance, I have ~/bin in mine, so I saved this as ~/bin/trello). forked from
#!/bin/bash
if [ $# -ne 2 ]
then
echo "Usage is: $0: <shorthand> \"<title>\"";
echo "For example: trello misc 'Do this and that'";
echo -e "\033[1m"; #bold header row
echo "| Shorthand | Board | List";
echo -ne "\033[0m";
echo "----------------------------------------"; #separate header row from table
@santoshachari
santoshachari / Virtual Blocks on Nginx.md
Last active January 7, 2024 11:57
Setup additional sites on Nginx

Inspired and edited from this Digital Ocean tutorial.

Follow the steps on this gist to setup a LEMP stack with PHP 7.0.

The steps assume Nginx has been configured correctly.

Setup the root directories

For the domains example.com and test.com, create the folders.

@santoshachari
santoshachari / Laravel PHP7 LEMP AWS.md
Last active February 20, 2024 10:00
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@WebReflection
WebReflection / multiple-uploads.md
Last active June 30, 2021 14:12
Uploading multiple files at once, and without jQuery

The aim of this gist is to fix the following informative post about uploading via XHR.

Fixing the HTML

The first part is the HTML. First of all, you really don't need JavaScript to upload a file but you do need a proper form. Secondly, inputs in a form shouild have a name, because the name is what the server will receive: not IDs, names!

Following the fixed form part.