Skip to content

Instantly share code, notes, and snippets.

View Bronskiy's full-sized avatar
💭
Seeking a position as a Full Stack, Frontend, Backend Developer

Nikolay Bronskiy Bronskiy

💭
Seeking a position as a Full Stack, Frontend, Backend Developer
View GitHub Profile
@Bronskiy
Bronskiy / mysqlCyrillicStringToSlug
Last active November 21, 2021 16:17
MySQL to convert cyrillic string(Russian Alphabet) into a slug
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(LOWER(TRIM('My String')), 'а', 'a'), 'б', 'b'), 'в', 'v'), 'г', 'g'), 'д', 'd'), 'е', 'e'), 'ё', 'e'), 'ж', 'j'), 'з', 'z'), 'и', 'i'), 'й', 'j'), 'к', 'k'), 'л', 'l'), 'м', 'm'), 'н', 'n'), 'о', 'o'), 'п', 'p'), 'р', 'r'), 'с', 's'), 'т', 't'), 'у', 'u'), 'ф', 'f'), 'х', 'h'), 'ц', 'c'), 'ч', 'ch'), 'ш', 'sh'), 'щ', 'sht'), 'ъ', 'y'), 'ы', 'i'), 'э', 'e'), 'ь', 'i'), 'ю', 'u'), 'я', 'ja') AS `post_name`
@Bronskiy
Bronskiy / mysqlStringToSlug
Last active November 19, 2021 20:42
MySQL to convert a string into a slug
LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM('My String'), ':', ''), ')', ''), '(', ''), ',', ''), '%', '') , '@', ''), '#', ''), '=', '-'), '^', ''), '+', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-')) AS `post_name`
@sam-suresh
sam-suresh / add-ssh-user.bash
Last active August 13, 2019 22:32 — forked from edheltzel/ADD_SFTP_User.md
steps to create new SFTP user/account
#### This is mainly for VMs managed by ServerPilot control panel using Ubuntu 14.04
#### But in theory will work for VMs in general ie: DigitalOcean or AWS instance
#### 1 Add new user
useradd mudotmy
#### 2 Follow on screen prompts - this will allow SFTP with the password set from the prompts
#### If there are no prompts just move on to Step 3 You will reset the password in the last step
#### 3 Update user's home directory to ServerPilots Apps OR vim /etc/passwd to change the new users path
@edheltzel
edheltzel / ADD_SFTP_User.md
Last active January 15, 2023 20:14
Steps to create a new SSH user and SFTP user

How to add a SFTP user to your VM managed by ServerPilot control panel using Ubuntu 14.04

I am not a security expert, so take it for what its worth.

OpenSSH has this ability built in, few people just seem to use the feature. Below is what works for me, but if you have a better way please share the uninformed.

The Steps:

  1. First create a new app inside of the SP control panel
  2. Now, decide what direcoty you want to put the users directory; either `` or /public. This will keep trolls at bay.
@brandonkelly
brandonkelly / templating.md
Last active February 7, 2024 15:20
Templating in EE vs. Craft
@ChromeOrange
ChromeOrange / functions.php
Created July 29, 2012 22:32
Replace all add to cart button text
<?php
// Single Product
add_filter( 'single_add_to_cart_text', 'custom_single_add_to_cart_text' );
function custom_single_add_to_cart_text() {
return 'Add to cart'; // Change this to change the text on the Single Product Add to cart button.
}
// Variable Product
add_filter( 'variable_add_to_cart_text', 'custom_variable_add_to_cart_text' );
@john-henry
john-henry / gist:3179683
Created July 26, 2012 01:07
Infinite Scroll & Masonry in ExpressionEngine
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="author" content="">
@bzerangue
bzerangue / recursively-rename-extension.sh
Created April 16, 2012 00:31
Terminal Script: Recursively rename or change file extensions (this example, changing extension from .html to .php)
find . -name "*.html" | while read i; do mv "$i" "${i%.html}.php"; done
@akost
akost / convert.sh
Created April 4, 2012 19:06
Bash script for recursive file convertion windows-1251 --> utf-8
#!/bin/bash
# Recursive file convertion windows-1251 --> utf-8
# Place this file in the root of your site, add execute permission and run
# Converts *.php, *.html, *.css, *.js files.
# To add file type by extension, e.g. *.cgi, add '-o -name "*.cgi"' to the find command
find ./ -name "*.php" -o -name "*.html" -o -name "*.css" -o -name "*.js" -type f |
while read file
do