This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.
— Erik
# ---------------------------------------------------------------------- | |
# Password protect staging server | |
# Use one .htaccess file across multiple environments | |
# (e.g. local, dev, staging, production) | |
# but only password protect a specific environment. | |
# ---------------------------------------------------------------------- | |
SetEnvIf Host staging.domain.com passreq | |
AuthType Basic | |
AuthName "Password Required" |
$env_conf['mail_protocol'] = 'smtp'; | |
$env_conf['smtp_server'] = 'tls://smtp.gmail.com:XXX'; // Use :XXX to set the port number. | |
$env_conf['smtp_username'] = '[email protected]'; | |
$env_conf['smtp_password'] = 'xxx'; | |
$env_conf['email_newline'] = "\r\n"; | |
$env_conf['email_crlf'] = "\r\n"; |
Below are two techniques to help debug the WSOD (white screen of death), usually a 500 server error, in an ExpressionEngine site. The Basic-Debugging option will be suitable in most cases and is specific to ExpressionEngine. The Advanced-Debugging is generic and applicable to any PHP based software. If the basic debugging does not work, try the advanced.
If you get a WSOD you will need to first get your site to reveal an error before reporting it to EllisLab or the add-on developer. Simply reporting "I get a white screen" does not give the developer enough information to assist you. An error message on the other hand will point the developer to the source of the issue.
Here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft CMS.
#!/bin/sh | |
# | |
# sandsync.sh | |
# | |
# This is a shell script for keeping sandbox and local EE | |
# environments in sync. It takes a backup of a project's sandbox database, | |
# clears the local database and imports the remote's backup into local, | |
# and performs a one-way sync of the uploads directory from remote to local. | |
# Drop it in the directory above your version-controlled projected directory. |
The idea is to set up ISO 639-1 language code prefixes for urls (e.g. en/, de/, fr/), and set global variables {global:lang}
and {global:lang_dir}
for use in your templates.
In the control panel create a category group "languages" and populate it with your languages, setting the category url title to the appropriate 2-letter language code. Assign the category group to the channels you want to translate.
For example:
Category Name | Category URL Title |
---|
$ = jQuery; | |
/* | |
* jQuery BBQ: Back Button & Query Library - v1.3pre - 8/26/2010 | |
* http://benalman.com/projects/jquery-bbq-plugin/ | |
* | |
* Copyright (c) 2010 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ |
#!/bin/bash | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
apt-get install pkg-config libmagickwand-dev -y | |
cd /tmp | |
wget https://pecl.php.net/get/imagick-3.4.4.tgz | |
tar xvzf imagick-3.4.4.tgz |
composer require omnilight/yii2-scheduling
to install the scheduling packageconfig/schedule.php
file to house your scheduled processesconfig/app.php
to include the schedule
component details to run the Craft command (instead of yii
)php craft schedule/run --scheduleFile=@config/schedule.php
to process any scheduled operations.💡 Tip: You likely want to run php craft schedule/run --scheduleFile=@config/schedule.php
on a cron job that fires every minute!