Skip to content

Instantly share code, notes, and snippets.

View Rulinski's full-sized avatar
🎯
Focusing

Vital Rulinski

🎯
Focusing
View GitHub Profile
@Rulinski
Rulinski / clean_code.md
Created May 24, 2024 07:20 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@Rulinski
Rulinski / .gitignore
Created February 24, 2019 19:44 — forked from salcode/.gitignore
.gitignore file for a general web project - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20181206
#
# From the root of your project run
# curl -O https://gist.github.com/salcode/10017553/raw/.gitignore
# to download this file
#
@Rulinski
Rulinski / nginx-tuning.md
Created February 8, 2019 08:29 — 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.

/* http://meyerweb.com/eric/tools/css/reset/
v2.0-modified | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@Rulinski
Rulinski / node_update.sh
Created January 23, 2019 18:51
update nodejs npm
#!/bin/bash
# Using Ubuntu
sudo apt update
sudo apt upgrade
#update npm
sudo npm install npm@latest -g
#update nodejs
@Rulinski
Rulinski / .gitignore
Created September 25, 2018 19:51 — forked from esamattis/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@Rulinski
Rulinski / ssh-tunnel.md
Created September 7, 2018 06:25 — forked from zulhfreelancer/ssh-tunnel.md
How psql the database in a remote server using SSH tunnel?

Format

First terminal (dev machine):

$ ssh -nNT -L local-port:127.0.0.1:remote-port remote-db-user@remote-ip

Second terminal (dev machine):

@Rulinski
Rulinski / fix-wordpress-permissions.sh
Created July 7, 2018 12:36 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@Rulinski
Rulinski / new-customer-coupon.php
Created May 18, 2017 20:53 — forked from devinsays/new-customer-coupon.php
Example for WooCommerce unit tests.
<?php
namespace WooCommerce\Tests\New_Customer_Coupon;
/**
* Class New_Customer_Coupon.
* @package WooCommerce\Tests\New_Customer_Coupon
*/
class New_Customer_Coupon extends \WC_Unit_Test_Case {