Skip to content

Instantly share code, notes, and snippets.

Marco Pfeiffer Nemo64

Block or report user

Report or block Nemo64

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Nemo64
Nemo64 / elevatorgame.js
Created Dec 21, 2018
my solution to the elevator game (not perfect)
View elevatorgame.js
{
init: function(elevators, floors) {
this.elevators = elevators;
this.floors = floors;
this.todos = [];
this.time = 0;
this.overSizeTheashold = 6;
for (let floor of floors) {
floor.on('down_button_pressed', () => this.addFloorButtonPush(floor, 'down'));
@Nemo64
Nemo64 / AbstractDbalRepository.php
Last active Oct 2, 2018
createQueryBuilder for typo3 extbase repository using dbal
View AbstractDbalRepository.php
<?php
namespace Vendor\Extension\Domain\Repository;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper;
@Nemo64
Nemo64 / poll.txt
Last active Sep 20, 2018
hauptsache.net essens poll
View poll.txt
/poll "Was wollen wir heute essen?
Ciao Bella: https://st-pauli.ciao-bella.de/mittagstisch/mittagstisch-der-woche.html
Taverna Romana: http://taverna-romana-hamburg.eu/our-menu/mittagstisch-menu/" "Ciao Bella (Italiener)" :pizza: "Döner/Paulis Kumpir (und Croque)/Thai Pauli" :stuffed_flatbread: "Azeitona (Falafel)" :broccoli: "Olympisches Feuer (Grieche)" :amphora: "Kleine Pause (Fast food)" :fries: "Asia Imbiss (Asiate)" :ramen: "Maharaja (Inder)" :curry: "Trattoria da Mario (Italiener)" :spaghetti: "Taverne Romana" :stew: "Graupi" :potato:
@Nemo64
Nemo64 / fulltextSearch.js
Created Mar 14, 2018
some utilities for searching though arrays
View fulltextSearch.js
(function ($, _) {
"use strict";
var escapeRegExp = function (str) {
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
};
var characterGlue = '[^a-zA-Z0-9]*';
var charMap = (function() {
@Nemo64
Nemo64 / gulpfile.js
Last active Sep 25, 2016
Gulp File for simple js project
View gulpfile.js
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var deployPath = 'dist';
gulp.task('default', ['build']);
gulp.task('build', ['js', 'css']);
gulp.task('watch', function () {
gulp.watch(['src/**'], ['js']);
@Nemo64
Nemo64 / githistory.sh
Created Nov 9, 2015
git history for multiple folders
View githistory.sh
#!/usr/bin/env bash
#!/usr/bin/env bash
REPS=`find /home/dev/Workspace -maxdepth 4 -type d -name ".git"`
USERNAME=`git config --get user.name`
echo "search for history of ${USERNAME}"
for REP in $REPS
do
@Nemo64
Nemo64 / .bashrc
Created Aug 31, 2014
Very dynamic and colorfull .bashrc
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files for examples
# Test for an interactive shell. There is no need to set anything
# past this point for scp and rcp, and it's important to refrain from
# outputting anything in those cases.
# If not running interactively, don't do anything!
[[ $- != *i* ]] && return
@Nemo64
Nemo64 / formhandler.js
Created Aug 25, 2014
common js form additions
View formhandler.js
/**
* User: Marco Pfeiffer
* Date: 04.04.13
* Time: 09:43
*/
(function ($) {
var IMPORTANT_FORMS = "form:not(.unimportant):not([target])";
var IMPORTANT_INPUT_FIELDS = ":input[name]:not(.unimportant)";
@Nemo64
Nemo64 / bootstrap_tabs.js
Created Jul 18, 2014
remember which bootstrap tab was active while navigating. This is a very cheap cookie trick and it requires jquery-cookie.
View bootstrap_tabs.js
// behavior for tabs
// FIXME can create unexpected behavior with multiple tabs on one page, also with multiple browser tabs/windows
$(document).on('click', '[data-toggle="tab"], [data-toggle="pill"]', function(event) {
var hash = $.prop(this, "hash");
$.cookie('active-tab', hash, { path: '/' });
});
$(window).on('popstate hashchange ready load', function() {
var cookieTab = $.cookie('active-tab');
var tab = cookieTab || null;
@Nemo64
Nemo64 / css-zoom.js
Created Jul 17, 2014
A polyfill for the zoom css property in firefox. The element that is zoomed must not have a margin though!
View css-zoom.js
$.cssNumber.zoom = true;
if (!("zoom" in document.body.style)) {
$.cssHooks.zoom = {
get: function(elem, computed, extra) {
var value = $(elem).data('zoom');
return value != null ? value : 1;
},
set: function(elem, value) {
var $elem = $(elem);
var size = { // without margin
You can’t perform that action at this time.