Here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft CMS.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name "*.html" | while read i; do mv "$i" "${i%.html}.php"; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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=""> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
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.
- First create a new app inside of the SP control panel
- Now, decide what direcoty you want to put the users directory; either `` or
/public
. This will keep trolls at bay.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |