Skip to content

Instantly share code, notes, and snippets.

Avatar
🤠
git commit -m "yolo"

mortendk mortendk

🤠
git commit -m "yolo"
View GitHub Profile
@mortendk
mortendk / Contract Killer 3.md
Created May 27, 2021 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer 3.md

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

View fractal config
# Your snippets
#
# https://www.hongkiat.com/blog/add-custom-code-snippets-atom/
'.source.yaml':
'':
'prefix': 'config-fractal'
'body':"""
#title:
#label:
View keybase.md

Keybase proof

I hereby claim:

  • I am mortendk on github.
  • I am mortendk (https://keybase.io/mortendk) on keybase.
  • I have a public key ASAnxM1of4DVXNKiDaZc3_SNXXaTT8hU0c7EilkPw4kp3wo

To claim this, I am signing this object:

View gist:37cdb508e407613816aa78103c53dd33
[base template name]--[view machine name]--[view display id].html.twig
[base template name]--[view machine name]--[view display type].html.twig
[base template name]--[view display type].html.twig2
[base template name]--[view machine name].html.twig
[base template name].html.twig
views styles
https://www.sitepoint.com/theming-views-in-drupal-8-custom-style-plugins/
View snippets.cson
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
@mortendk
mortendk / input--submit.html.twig
Created Jul 16, 2016
input submit as buttons
View input--submit.html.twig
{{ attach_library(active_theme()~'/form') }}
{# find the unique name for the button. #}
{% if element['#value'].getUntranslatedString() %}
{% set element_name = element['#value'].getUntranslatedString()|clean_class %}
{% else %}
{% set element_name = element['#value']|clean_class %}
{% endif %}
{# We dont use form-submit or button--primary for the css so lets remove it. #}
@mortendk
mortendk / image-widget.html.twig
Created Jul 13, 2016
image widget upload label as a button trick
View image-widget.html.twig
{#
.theme:
function birch_preprocess_image_widget(&$variables, $hook) {
// the image widget needs to know what the label is
// look in admin/image-widget.hmtl.twig
$variables['form_label_id'] = $variables['element']['#id'];
}
#}
{#
@mortendk
mortendk / themenameinfo.yml
Created May 18, 2016
tell modernizr to fuck out of your theme in drupal 8
View themenameinfo.yml
libraries-override:
core/modernizr: false
@mortendk
mortendk / menu--main.html.twig
Created May 9, 2016
complete menu link control to the max Drupal twig
View menu--main.html.twig
{% import _self as menus %}
{#
We call a macro which calls itself to render the full tree.
@see http://twig.sensiolabs.org/doc/tags/macro.html
#}
{{ menus.menu_links(items, attributes, 0) }}
{% macro menu_links(items, attributes, menu_level) %}
{% import _self as menus %}
View vanilla.theme
/**
* Implements hook_preprocess_menu().
*/
function vanilla_preprocess_menu(&$vars, $hook) {
if ($hook == 'menu_main') {
kint($hook);
$items = $vars['items'];
foreach ($items as $key => $item) {
$original_title = $vars['items'][$key]['title'];
$vars['items'][$key]['title'] = array(