Skip to content

Instantly share code, notes, and snippets.

@hhhonzik
hhhonzik / deploy.yml
Last active April 22, 2024 10:30
Kinsta Deployment
# Kinsta Deployment through Github Actions for Bedrock/Sage.
#
# Placed at: .github/workflow/deploy.yml
#
# Process should be studied from code, but some quick brief:
# - runs composer / sage installation
# - moves correct `.env.*` file for multiple configs
# - uses rsync to sync files, uses /.rsyncignore file to exclude whatever should not be there
# - symlinks uploads folder and symlink release folder to kinsta public hostname
# - if you want to clear cache, please uncomment the last job
04698ec77700615d9e246ae60c92c051953b3d31b2e152133cbd0bac7002aff3ba5a67022e49fe4feec9746fe8671a0b5b3418f57fd09c4c7a1a4cc133c1d8e1ee;aarontc
@hhhonzik
hhhonzik / make_url.js
Created April 6, 2016 16:35
Make friendly URL from any string.
const nodiac = { 'á': 'a', 'č': 'c', 'ď': 'd', 'é': 'e', 'ě': 'e', 'í': 'i', 'ň': 'n', 'ó': 'o', 'ř': 'r', 'š': 's', 'ť': 't', 'ú': 'u', 'ů': 'u', 'ý': 'y', 'ž': 'z' };
/** Friendly URL
* @param s string with spaces and weird chars.
* @return string URL friendly
*/
function make_url(s) {
return s.toLowerCase()
.split('')
.map(
letter => nodiac[letter] || letter