Skip to content

Instantly share code, notes, and snippets.

@peterdalle
peterdalle / robots.txt
Created December 3, 2016 15:18
Robots.txt that makes sure Facebook and Twitter can crawl images on your site.
# 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
@magnetikonline
magnetikonline / README.md
Last active March 14, 2024 22:48
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
@ejlp12
ejlp12 / gist:059373f1785c52114d778a4ee7277ccb
Created October 25, 2017 01:45
upgrade vagrant on mac os-x
brew cask reinstall vagrant
# this might take a long time
vagrant plugin update
@Neoglyph
Neoglyph / rgb2cmyk.php
Last active November 17, 2023 21:57
Convert RGB to CMYK in PHP with Imagick
<?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);
@shakee93
shakee93 / .htaccess
Created January 31, 2017 17:45
Laravel Apache hide .env and several security settings via .htaccess
# 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 '|'
@cliffordp
cliffordp / functions.php
Last active September 23, 2023 06:22
Automatically login a single WordPress user upon arrival to a specific page.
<?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.
*
@hackjutsu
hackjutsu / .leptonrc
Last active December 7, 2022 01:01
[Template for .leptonrc] This is a template for Lepton's configuration file. Please place it on your home directory. #lepton
{
"theme": "light",
"autoUpdate": false,
"snippet": {
"expanded": true,
"newSnippetPrivate": false,
"sorting": "updated_at",
"sortingReverse": true
},
"editor" : {
<?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);
@iamandrewluca
iamandrewluca / MyModel.php
Last active June 17, 2022 12:34
typo3 extbase categories
<?php
/**
* categories
*
* \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category>
* @lazy
*/
protected $categories;
/**
* MyModel constructor.
@kathangeorg
kathangeorg / ts.ts
Created May 2, 2012 14:08
Typo3 TypoScript Variablen wie page : uid auslesen
temp.typo3Variable = COA
temp.typo3Variable {
5 = TEXT
5 {
# Datum
insertData = 1
data = date : d-m-y
wrap = <p> Das Datum heute: | </p>
}