Skip to content

Instantly share code, notes, and snippets.

View screeny05's full-sized avatar

Sebastian Langer screeny05

View GitHub Profile
@screeny05
screeny05 / idleThrottle.js
Created September 14, 2017 09:14
Idle Throttle - Just like a regular throttle, except that it waits for idle or timeout
var idleThrottle = function(cb, timeout){
var idleId;
return function(){
if(idleId){
cancelIdleCallback(idleId);
}
idleId = requestIdleCallback(cb, { timeout: timeout });
};
};
var idleThrottle = function(timeoutMin, timeoutMax, cb){
var idleId;
return function(){
var lastCall = Date.now();
var queueIdleCheck = function(timeout){
idleId = requestIdleCallback(function(){
var currentCall = Date.now();
var timeSinceLastCall = currentCall - lastCall;
<script>
/*<!-- START headerTags.cfm -->
<!-- BC_OBNW -->
<!-- FwP Systems -->
<!-- Factfinder -->
<!-- EBiS contents tag -->
<!-- powered by Contao -->
<!-- DNN Platform -->
<!-- Powered by GX -->
<!-- Start of Async HubSpot -->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
napi_value napi_glGetShaderiv(napi_env env, napi_callback_info info) {
GET_NAPI_PARAMS_INFO(3, "getShaderiv(shader: number, pname: number, length: number): Int32Array");
GET_NAPI_PARAM_UINT32(shader, 0);
GET_NAPI_PARAM_UINT32(pname, 1);
GET_NAPI_PARAM_UINT32(length, 2);
// declare & alloc
napi_value output_buffer;
void* paramsPointer = NULL;
NAPI_CALL(env, napi_create_arraybuffer(env, length * sizeof(GLint), &paramsPointer, &output_buffer));
@screeny05
screeny05 / meetnext.md
Created November 1, 2017 08:16
Shopware #meetnext notes

https://developers.shopware.com/labs/

Common

  • Goodbye Doctrine ORM
  • Structs all the way
  • Entity in Bundle aus { reader, writer, searcher }
  • bessere übersetzungen
    • kategorie = kategorie
  • alles über apis
@screeny05
screeny05 / scsv-extract-snippets.js
Created November 1, 2017 16:28
Extract Shopware Snippets of a given language from the snippets export
const fs = require('fs');
// SCSV = Shopware Crappy Separated Values (SW Export Format)
const parseScsvLine = l => {
l = l.trim();
const tokens = [];
let buf = '';
let isOpenEntity = false;
@screeny05
screeny05 / papershift-overtime.js
Created November 2, 2017 11:17
Papershift overtime calculator (paste in console)
(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', ''));
<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>
<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>