Skip to content

Instantly share code, notes, and snippets.

View iberezovchuk's full-sized avatar
🐘
\m/

Igor Berezovchuk iberezovchuk

🐘
\m/
View GitHub Profile
@iberezovchuk
iberezovchuk / template.php
Created January 16, 2015 16:51
#Drupal: Changing fie icon
function themeName_file_icon($variables) {
$file = $variables['file'];
$icon_directory = $variables['icon_directory'];
$mime = check_plain($file->filemime);
if ($mime == 'application/vnd.ms-excel') {
$icon_directory = path_to_theme() . '/images';
}
$icon_url = file_icon_url($file, $icon_directory);
return '<img class="file-icon" alt="" title="' . $mime . '" src="' . $icon_url . '" />';
@iberezovchuk
iberezovchuk / index.html
Created July 15, 2016 10:13
All Favicons for All Devices and Sizes
<link rel="shortcut icon" sizes="16x16 24x24 32x32 48x48 64x64" href="https://scotch.io/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="/wp-content/themes/thirty/img/icons/favicon-57.png">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="/wp-content/themes/thirty/img/icons/favicon-57.png">
<link rel="apple-touch-icon" sizes="72x72" href="/wp-content/themes/thirty/img/icons/favicon-72.png">
<link rel="apple-touch-icon" sizes="114x114" href="/wp-content/themes/thirty/img/icons/favicon-114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/wp-content/themes/thirty/img/icons/favicon-120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/wp-content/themes/thirty/img/icons/favicon-144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/wp-content/themes/thirty/img/icons/favicon-152.png">
<meta name="application-name" content="Scotch Scotch scotch">
<meta name="msapplication-TileImage" content="/wp-content/themes/thirty/img/icons/favicon-144.png">
@iberezovchuk
iberezovchuk / drupal-8.form.reset-button.php
Last active April 25, 2019 13:31 — forked from RuZniki/drupal-8.form.reset-button.php
Drupal 8 Adding a Reset Button to a form
<?php
/**
* Implements template_preprocess_form().
*/
function TEMPLATE_preprocess_form(&$vars) {
$vars['form']['actions']['reset'] = [
'#type' => 'html_tag',
'#tag' => 'input',
'#attributes' => [
'class' => 'button',