Skip to content

Instantly share code, notes, and snippets.

View Nemo64's full-sized avatar

Marco Pfeiffer Nemo64

View GitHub Profile
@Nemo64
Nemo64 / mobile-setup.ts
Last active May 31, 2016 04:27
typo3 typoscript - header information for mobile devices
# mobile device meta
headerData.5 = COA
headerData.5 {
# general meta tags
1 = TEXT
1.value (
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
)
@Nemo64
Nemo64 / gulpfile.js
Last active September 25, 2016 22:13
Gulp File for simple js project
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 / fulltextSearch.js
Created March 14, 2018 15:42
some utilities for searching though arrays
(function ($, _) {
"use strict";
var escapeRegExp = function (str) {
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
};
var characterGlue = '[^a-zA-Z0-9]*';
var charMap = (function() {
@Nemo64
Nemo64 / poll.txt
Last active September 20, 2018 11:27
hauptsache.net essens poll
/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 / AbstractDbalRepository.php
Last active October 2, 2018 09:46
createQueryBuilder for typo3 extbase repository using dbal
<?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 / elevatorgame.js
Created December 21, 2018 15:41
my solution to the elevator game (not perfect)
{
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 / userscript.js
Created July 22, 2019 16:19
This is a userscript for tampermonkey to automatically remove a bunch of urls from google.
// ==UserScript==
// @name Bulk removal google hack
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Bulk remove a search result from google
// @author Marco Pfeiffer
// @match https://www.google.com/webmasters/tools/removals*
// @grant none
// ==/UserScript==
@Nemo64
Nemo64 / remove-all-passwords.js
Created June 19, 2020 09:36
a script you can execute to delete all password in chrome. You may need to run it multiple times due to timing issues.
// $0 = <password-list-item> so you'll need to pick that element in your browser first
// then execute this script until your password list is empty (there is a timing issue but after about 3 tries the password list is empty)
$0.parentNode.querySelectorAll('password-list-item').forEach(item => {
item.shadowRoot.querySelector('#passwordMenu').click();
item.parentNode.parentNode.parentNode.querySelector('#menuRemovePassword').click();
})
@Nemo64
Nemo64 / main.cpp
Last active February 20, 2021 23:35
This is a test sketch to read voltages using an esp32.
// This sketch shows how to read voltages from an esp32
// Your ESP has to be manufactured in 2018 or newer for the values to be burned into eFuse.
// more infos here:
// https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/adc.html#adc-calibration
#include <Arduino.h>
#include <esp_adc_cal.h>
esp_adc_cal_characteristics_t chars;
@Nemo64
Nemo64 / main.cpp
Created March 15, 2021 17:33
Untested way of disabling power management of an esp32
#include <Arduino.h>
#include <esp_pm.h>
void setup()
{
Serial.begin(115200);
Serial.setDebugOutput(true);
esp_pm_lock_handle_t powerLock;
if (esp_pm_lock_create(ESP_PM_CPU_FREQ_MAX, 0, "", &powerLock) != ESP_OK) {