This file contains hidden or 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 | |
$iccProfile = '../path_to_icc/Profile.icc'; | |
$image = new Imagick(); | |
$image->clear(); | |
$image->readImage($imagePath); | |
if ($image->getImageColorspace() == Imagick::COLORSPACE_CMYK) { | |
return; | |
} | |
$iccCmyk = file_get_contents($iccProfile); |
This file contains hidden or 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
brew cask reinstall vagrant | |
# this might take a long time | |
vagrant plugin update |
This file contains hidden or 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
{ | |
"theme": "light", | |
"autoUpdate": false, | |
"snippet": { | |
"expanded": true, | |
"newSnippetPrivate": false, | |
"sorting": "updated_at", | |
"sortingReverse": true | |
}, | |
"editor" : { |
This file contains hidden or 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 | |
define('SLACK_WEBHOOK', 'https://hooks.slack.com/services/xxx/yyy/zzz'); | |
define('TELEGRAM_BOT_TOKEN', '...'); | |
define('TELEGRAM_CHAT_ID', '12345'); | |
function slack($txt) { | |
$msg = array('text' => $txt); | |
$c = curl_init(SLACK_WEBHOOK); | |
curl_setopt($c, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false); |
This file contains hidden or 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
# Disable Directory listing | |
Options -Indexes | |
# block files which needs to be hidden // in here specify .example extension of the file | |
<Files ~ "\.(env|json|config.js|md|gitignore|gitattributes|lock)$"> | |
Order allow,deny | |
Deny from all | |
</Files> | |
# in here specify full file name sperator '|' |
This file contains hidden or 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
# Disallow everything. | |
User-agent: * | |
Disallow: / | |
# Certain social media sites are whitelisted to allow crawlers to access page markup when links to /images are shared. | |
User-agent: Twitterbot | |
Allow: /images | |
User-agent: facebookexternalhit | |
Allow: /images |
This file contains hidden or 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 | |
# SET Variables | |
NOW="$(date +"%d-%m-%Y_%H-%M-%S")" | |
ROOT_PATH="/home/www/p177910/html" | |
DIRECTORY_TO_SAVE="$ROOT_PATH/typo3" | |
BACKUP_TO_DIRECTORY="$ROOT_PATH/backup" | |
LOGFILE="$ROOT_PATH/backup/log/yourlogfile.log" | |
USER=who | |
DB_USER="" |
This file contains hidden or 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
{namespace dce=ArminVieweg\Dce\ViewHelpers} | |
<f:layout name="Default" /> | |
<f:section name="main"> | |
<f:for each="{dce:fal(field:'images', contentObject:contentObject)}" as="image"> | |
<!-- This is the normal unresponsive way --> | |
<f:image image="{image}" /> | |
<!-- Here we referer to typoscript to render the responsive image --> | |
<f:cObject typoscriptObjectPath="lib.responsiveImage" data="{image.uid}"></f:cObject> | |
</f:for> |
This file contains hidden or 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 | |
/** | |
* Automatically login a single WordPress user upon arrival to a specific page. | |
* | |
* Redirect to home page once logged in and prevent viewing of the login page. | |
* Compatible with WordPress 3.9.1+ | |
* Updated 2014-07-18 to resolve WP_DEBUG notice: "get_userdatabylogin is deprecated since version 3.3! Use get_user_by('login') instead." | |
* Updated 2019-07-09 to reformat code, pass 2nd parameter to `do_action()`, and hook into priority 1. | |
* |
This file contains hidden or 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
1. Create ext_tables.sql and add new fields as usual | |
2. Create Configuration/TCA/Overrides/tablename.php and extend TCA therein (before: ext_tables.php) | |
3. Add the following lines to your ext_localconf.php. Where the first argument of "registerImplementation" is the model class you would like to extend and the second argument is your own implementation. | |
$extbaseObjectContainer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\Container\\Container'); | |
$extbaseObjectContainer->registerImplementation('Tx_News_Domain_Model_NewsDefault', 'thinkopen_at\T3ff\Domain\Model\NewsT3ff'); | |
4. Create your own implementation of the mode class and add the new properties + getters/setters for them |
NewerOlder