This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Sebastian Langer <sl@scn.cx> | |
* @license MIT | |
*/ | |
use Shopware\Bundle\StoreFrontBundle\Service\Core\ContextService; | |
use Shopware\Bundle\StoreFrontBundle\Gateway\DBAL\MediaGateway; | |
use Shopware\Components\Compatibility\LegacyStructConverter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Shopware\Bundle\StoreFrontBundle\Service\Core\ContextService; | |
use Shopware\Bundle\StoreFrontBundle\Gateway\DBAL\MediaGateway; | |
use Shopware\Components\Compatibility\LegacyStructConverter; | |
use Enlight_Template_Default; | |
use InvalidArgumentException; | |
/** | |
* @author Sebastian Langer <sl@scn.cx> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class State<T> { | |
abstract id: T; | |
isCurrent: boolean = false; | |
listeners: { [key: string]: Function } = {}; | |
fsm!: StateMachine<T>; | |
on(event: string, cb: Function): void { | |
this.listeners[event] = cb; | |
} | |
trigger(event: string, data?: any): void { | |
if (!this.listeners.hasOwnProperty(event)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Color = string; | |
class Player { | |
constructor(public name: string, public color: Color){ } | |
} | |
type Field = Player|null; | |
class GameField { | |
private fields: Field[][]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jquery.d.ts | |
interface JQuery { | |
toggleClass(name: string, add: boolean): JQuery; | |
} | |
interface JQueryStatic { | |
(...any): JQuery; | |
fn: JQuery; | |
} | |
declare const $: JQueryStatic; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const parsePagination = s => | |
s | |
.split(',') | |
.map(s => { | |
if(s.match(/^\d+$/)){ | |
return parseInt(s); | |
} | |
if(s.match(/^\d+-\d+$/)){ | |
s = s.split('-'); | |
return Array(s[1] - s[0] + 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const names = [ | |
'arved', | |
'ahmad', | |
'sebastian', | |
'marcel' | |
]; | |
const randomIndexFromArray = array => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="overlay"> | |
OVERLAY | |
<div class="scroll--container"> | |
<div class="scroll"> | |
<a href="#" class="scroll--link">Link</a> | |
<a href="#" class="scroll--link">Link</a> | |
<a href="#" class="scroll--link">Link</a> | |
<a href="#" class="scroll--link">Link</a> | |
<a href="#" class="scroll--link">Link</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body id="body" style="" class=""> | |
<div class="" style=" height: 1000vh; "></div> | |
<div class="org" style="top: 0px; width: 750px; height: auto; display: block; opacity: 1;position: fixed; bottom: auto;right: 0; left: 0; top: 0; bottom: 0; margin: auto; background: padding-box #fff; max-height: 100%; max-width: 100%; z-index: 7000; overflow-x: hidden; overflow-y: auto;"> | |
<div class="" style=" height: 120px; background: aqua; "></div> | |
<div class="" style=" background: magenta; height: 200px; "></div> | |
<div class="" style=" white-space: nowrap; overflow: auto; "> | |
<span class="" style="width: 100%;display: inline-block;background: tomato;height: 90vh;"></span> | |
<span class="" style="width: 100%;display: inline-block;height: 400px;background: rebeccapurple;"></span> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function getOvertime(){ | |
const padLeftTwo = str => ('' + str).length === 1 ? '0' + str : str; | |
const now = new Date(); | |
const today = now.getFullYear() + '' + padLeftTwo(now.getMonth() + 1) + '' + padLeftTwo(now.getDate()); | |
const days = {}; | |
$('#time_trackings_list .entry').each((i, el) => { | |
const dayKey = $(el).find('.day span').text().slice(0,8); | |
const dayHours = parseFloat($(el).find('.netto_time').text().replace(' h', '')); |