Skip to content

Instantly share code, notes, and snippets.

@loominade
loominade / jqueryScrollRight.js
Created April 1, 2015 08:02
ever bothered there is a scrollLeft() but no scrollRight() function in jQuery?
$.fn.extend({
scrollRight: function(property) {
return this[0].scrollWidth - (this[0].scrollLeft + this[0].clientWidth) + 1;
}
});
<div id="gangster-wrapper">
<div id="gangster"></div>
</div>
@loominade
loominade / html.txt
Created October 5, 2015 09:54
all html attributes
accept,accept-charset,accesskey,action,align,alt,async,autocomplete,autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,data,datetime,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,for,form,formaction,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low,manifest,max,maxlength,media,method,min,multiple,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,pubdate,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,seamless,selected,shape,size,sizes,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,type,usemap,value,width,wrap
@loominade
loominade / drupal-8-remove-breaks-in-debug.diff
Last active March 16, 2022 07:22
Removes whitespace caused by the twig debug mode in Drupal 8.
--- /core/themes/engines/twig/twig.engine
+++ /core/themes/engines/twig/twig.engine
@@ -74,8 +74,8 @@
throw $e;
}
if ($twig_service->isDebug()) {
- $output['debug_prefix'] .= "\n\n<!-- THEME DEBUG -->";
- $output['debug_prefix'] .= "\n<!-- THEME HOOK: '" . Html::escape($variables['theme_hook_original']) . "' -->";
+ $output['debug_prefix'] .= "<!-- THEME DEBUG -->";
+ $output['debug_prefix'] .= "<!-- THEME HOOK: '" . Html::escape($variables['theme_hook_original']) . "' -->";
@loominade
loominade / uncomment-rewrite-base-in-drupal-8-htaccess.diff
Last active July 10, 2017 14:09
Uncomment rewrite base in drupal 8 htaccess
--- /.htaccess
+++ /.htaccess
@@ -120,7 +120,7 @@
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
- # RewriteBase /
+ RewriteBase /
# Redirect common PHP files to their new locations.
@loominade
loominade / readme.md
Created July 31, 2017 11:57
Gulp iconfont ligatures

This is a test of the ligature feature in gulp iconfont.

@loominade
loominade / unicode-regex.php
Last active August 1, 2017 15:51
unicode aware \w regex
<?php
$regex = "%(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|\u{00c4}|\u{00c0}|\u{00c1}|\u{00c2}|\u{00c6}|\u{00c3}|\u{00c5}|\u{0100}|\u{00e4}|\u{00e0}|\u{00e1}|\u{00e2}|\u{00e6}|\u{00e3}|\u{00e5}|\u{0101}|\u{00d6}|\u{00d4}|\u{00d2}|\u{00d3}|\u{0152}|\u{00d8}|\u{014c}|\u{00f6}|\u{00f4}|\u{00f2}|\u{00f3}|\u{00f5}|\u{0153}|\u{00f8}|\u{014d}|\u{00dc}|\u{00db}|\u{00d9}|\u{00da}|\u{016a}|\u{00fc}|\u{00fb}|\u{00f9}|\u{00fa}|\u{016b}|\u{00c9}|\u{00c8}|\u{00ca}|\u{00cb}|\u{0116}|\u{00e9}|\u{00e8}|\u{00ea}|\u{00eb}|\u{0117}|\u{00ee}|\u{00ef}|\u{00ed}|\u{012b}|\u{00ec}|\u{00e7}|\u{0107}|\u{010d}|\u{00f1}|\u{0144}|\u{00df}|\u{015b}|\u{0161}|\u{0178}|\u{00ff})%";
?>
diff --git a/core/themes/engines/twig/twig.engine b/core/themes/engines/twig/twig.engine
index 177e01a511..cb78624cf8 100644
--- a/core/themes/engines/twig/twig.engine
+++ b/core/themes/engines/twig/twig.engine
@@ -74,8 +74,8 @@ function twig_render_template($template_file, array $variables) {
throw $e;
}
if ($twig_service->isDebug()) {
- $output['debug_prefix'] .= "\n\n<!-- THEME DEBUG -->";
- $output['debug_prefix'] .= "\n<!-- THEME HOOK: '" . Html::escape($variables['theme_hook_original']) . "' -->";

BEM Cheatsheet

BLOCK

Block encapsulates a standalone entity that is meaningful on its own.

While blocks can be nested and interact with each other, semantically they remain equal; there is no precedence or hierarchy.

Holistic entities without DOM representation (such as controllers or models) can be blocks as well.

// ==UserScript==
// @name List to redmine ticket
// @namespace https://redmine.loom.de
// @version 0.1
// @updateURL https://gist.github.com/loominade/078521409ca84345b133b451f57af78d/raw/02ca789c973667147e393c9e132f185e8f6a053e/list-to-subticket.user.js
// @downloadURL https://gist.github.com/loominade/078521409ca84345b133b451f57af78d/raw/02ca789c973667147e393c9e132f185e8f6a053e/list-to-subticket.user.js
// @description create tickets from lists
// @author You
// @match https://redmine.loom.de/*
// @grant none