Skip to content

Instantly share code, notes, and snippets.

View screeny05's full-sized avatar

Sebastian Langer screeny05

View GitHub Profile
@screeny05
screeny05 / aeach.js
Last active August 29, 2015 14:24
async js fn-queuing
async.each = function(toIterate, fn, callback){
var calledCount = 0;
for (var i = 0; i < toIterate.length; i++) {
fn(toIterate[i], function(err){
if(err){
callback(err);
callback = function(){};
return;
}
calledCount++;

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

$(':not([class], [id], [name], [for], [style], [itemprop], [href], [src], [property], [content], [lang], [charset], [rel], [value], [alt], [title], [action], [method], [type], [scoped], [required], br, body, head, html)')
@screeny05
screeny05 / bemlinter.js
Created November 10, 2016 09:59
BEM / ITCSS Linter
(function bemLinter(){
const namespaces = ['o', 'c', 'u', 's', 't', 'is', 'has'];
const suffixes = ['xs', 's', 'ms', 'sm', 'md', 'lg', 'l', 'xl', 'print'];
const SEVERITY_ERROR = 'error';
const SEVERITY_WARNING = 'warn';
const SEVERITY_INFO = 'info';
const ERR_TYPE_STRAY_ELEMENT = 'stray-element';
const ERR_TYPE_MISSING_NAMESPACE = 'missing-namespace';
@screeny05
screeny05 / sw5.htaccess
Last active December 8, 2016 13:53 — forked from emtii/sw5.htaccess
Shopware 5 mod_expires & mod_filter
<IfModule mod_mime.c>
# Missing media types
AddType audio/mp4 f4a f4b m4a
AddType audio/ogg oga ogg opus
AddType image/bmp bmp
AddType image/svg+xml svg svgz
AddType image/webp webp
AddType video/mp4 f4v f4p m4v mp4
AddType video/ogg ogv
AddType video/webm webm
@screeny05
screeny05 / sw-compile-theme.sh
Created December 12, 2016 09:32
shopware compile all themes
bin/console sw:theme:dump:config
cd themes
for f in ../web/cache/config_*.json;
do sudo grunt less:production uglify:production --config-id=$(echo $f | grep -Po '\d+');
done
<?php
/**
* Custom EventExtension needed to subscribe to global buildForm Event
*/
use Shopware\Bundle\FormBundle\Extension\EventExtension;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
<?php
/**
* Turn a media-id into a valid path
* @param $params
* @param $template
* @return string
*/
function smarty_function_mediaById($params, $template)
{
$id = $params['id'];
{if $sArticle.sSimilarArticles}
{* Similar products - Content *}
{block name="frontend_detail_index_similar_slider_content"}
<div class="similar--content">
{include file="frontend/_includes/product_slider.tpl" articles=$sArticle.sSimilarArticles}
</div>
{/block}
{/if}
@screeny05
screeny05 / shopware-captcha-fill.js
Last active February 22, 2017 14:11
Fill in Shopware Captchas
!function(n){"use strict";function t(n,t){var r=(65535&n)+(65535&t),e=(n>>16)+(t>>16)+(r>>16);return e<<16|65535&r}function r(n,t){return n<<t|n>>>32-t}function e(n,e,o,u,c,f){return t(r(t(t(e,n),t(u,f)),c),o)}function o(n,t,r,o,u,c,f){return e(t&r|~t&o,n,t,u,c,f)}function u(n,t,r,o,u,c,f){return e(t&o|r&~o,n,t,u,c,f)}function c(n,t,r,o,u,c,f){return e(t^r^o,n,t,u,c,f)}function f(n,t,r,o,u,c,f){return e(r^(t|~o),n,t,u,c,f)}function i(n,r){n[r>>5]|=128<<r%32,n[(r+64>>>9<<4)+14]=r;var e,i,a,h,d,l=1732584193,g=-271733879,v=-1732584194,m=271733878;for(e=0;e<n.length;e+=16)i=l,a=g,h=v,d=m,l=o(l,g,v,m,n[e],7,-680876936),m=o(m,l,g,v,n[e+1],12,-389564586),v=o(v,m,l,g,n[e+2],17,606105819),g=o(g,v,m,l,n[e+3],22,-1044525330),l=o(l,g,v,m,n[e+4],7,-176418897),m=o(m,l,g,v,n[e+5],12,1200080426),v=o(v,m,l,g,n[e+6],17,-1473231341),g=o(g,v,m,l,n[e+7],22,-45705983),l=o(l,g,v,m,n[e+8],7,1770035416),m=o(m,l,g,v,n[e+9],12,-1958414417),v=o(v,m,l,g,n[e+10],17,-42063),g=o(g,v,m,l,n[e+11],22,-1990404162),l=o(l,g,v,m,n[e+12],7,18046036