Skip to content

Instantly share code, notes, and snippets.

View BananaAcid's full-sized avatar

Nabil Redmann BananaAcid

View GitHub Profile
@BananaAcid
BananaAcid / Autodiscover.aspx
Last active March 8, 2022 14:48
autodiscover for Outlook, working with hMailServer (and other IMAP, SMTP connections) in C# on IIS
<%@ Page Language="C#" %>
<% Response.ContentType = "text/xml";
/*
repo+gist@bananaacid.de
Nabil Redmann 2016
Requirements:
/*
* User: BananaAcid
* Date: 30.07.2012
* Type: Commandline
*/
using System;
using System.IO;
using System.Linq;
using System.Text;
/*
* User: BananaAcid
* Date: 09.02.2011
* Type: Commandline
* Note: Form data extraction to csv from email (*.eml) files
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@BananaAcid
BananaAcid / README.md
Last active September 21, 2016 00:05
Example: basic TCP messaging

A simple TCP-server setup.

[Using Node-RED]

Easy to test your clients used. Like Telnet and others.

Contains:

  • Server
  • Client
  • Proxy (for clients not terminating their messages with \n)
@BananaAcid
BananaAcid / autoshrink.js
Last active October 20, 2016 05:40 — forked from andrewbranch/autoshrink.js
Responds to window resize events. Max font size taken from initial font size (specify with CSS). [no modifications, just forked to extend the example.]
(function($) {
function getTextWidth($element) {
var tester = $("<div/>").text($element.text())
.css({ "position": "absolute", "float": "left", "white-space": "nowrap", "visibility": "hidden", "font": $element.css("font"), "text-transform": $element.css("text-transform"), "letter-spacing": $element.css("letter-spacing") })
.appendTo($element.parent()),
width = tester.innerWidth();
tester.remove();
return width;
}
@BananaAcid
BananaAcid / .htaccess
Created January 8, 2017 14:25
Subdomain mapping within htaccess
# Nabil Redmann 2017
#
# assumed: this htaccess is within htdocs/
#
# dev.* mapping to ./dev/
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
@BananaAcid
BananaAcid / result
Last active August 17, 2017 23:14
koa-better-router subdirs + includes
// ˫ routes ˫ index.js
GET /
// ˫ routes ˫ api1 ˫ index.js
GET /api/v1/
GET /api/v1/x
// ˫ routes ˫ api1 ˫ a.js
PUT /api/v1/a/obj/:one/:two
//-
PhpStorm 2018.1 shows multiple errors and is not able to handle this fully valid PUG mixin
mixin test(param1, param2 = "test", optionalParam3)
- var xOptionalParam3 = optionalParam3 || "is none";
<!{param1}> !{param2} => !{xOptionalParam3} </!{param1}>
@BananaAcid
BananaAcid / precompile pug with normal php - pug file src
Last active April 19, 2019 21:54
Working with PUG (Jade) and PHP to generate HTML with PHP (Pug2PHP)
//-
using the PUGjs pre-compiler, ($ npm i -g pug )
HTML with included PHP will be generated as .php -
then served using the webserver as any other PHP file
note:
lines starting with `<` will be handled as if they were prefixed
with `|` (pipe) == that is: as text.
indented lines are not inheriting the text-content-mode.
@BananaAcid
BananaAcid / RGB-blink-n-toggle.ino
Last active May 24, 2018 15:58
Toggle 3 leds (or an RGB) - mode 0 is switching pins 1-3 (Arduino / ESP32 / ESP8266)