Skip to content

Instantly share code, notes, and snippets.

View WengerK's full-sized avatar
🤓

Kevin Wenger WengerK

🤓
View GitHub Profile
@WengerK
WengerK / fields.php
Created June 13, 2016 08:25
Drupal 8 - Liste of fields types
// The list of possible types:
kint(\Drupal::service('plugin.manager.field.field_type')->getDefinitions());
@WengerK
WengerK / mails.php
Created June 6, 2016 14:09
Drupal 8 - Send mail with Swiftmailer
<?php
use Drupal\Core\Render\Markup;
/**
* Mail hook
*/
function hook_mail($key, &$message, $params) {
$options['langcode'] = $message['langcode'];
@WengerK
WengerK / .htaccess
Created May 3, 2016 18:58 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@WengerK
WengerK / gist:7f42c07aa5f12ab741b4
Last active August 29, 2015 14:16
Check for SSL FREAK Vulnerability
# Fire this command to check your vulnerability
# A handshake failure signifies that EXPORT cipher is not active on the server and it is safe.
openssl s_client -connect www.google.com:443 -cipher EXPORT
@WengerK
WengerK / drupal.module
Created February 27, 2014 15:26
Drupal custom module - How to disable 'promote to front page' and 'sticky' options?
<?php
/**
* Use hook_form_alter to unset both options on node edit forms.
* But on the main admin content page, the options still appear under 'Update options' dropdown.
*/
/**
* Implements hook_form_alter().
* This is remove the promote to frontpage, and make sticky options from node edit pages
@WengerK
WengerK / By attributes
Created November 21, 2012 11:00
Dynamic change title & meta page on ASP
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Title="MyTitle" Inherits="ASP1._Default" MasterPageFile="~/MasterPage.Master" %>