Skip to content

Instantly share code, notes, and snippets.

View naltatis's full-sized avatar

Michael Geers naltatis

View GitHub Profile
@bicaluv
bicaluv / evcc.10s.rb
Last active February 12, 2023 15:56
#!/usr/bin/env ruby
# Metadata allows your plugin to show up in the app, and website.
# changed from xbar to SwiftBar: https://github.com/swiftbar/SwiftBar
#
# <xbar.title>evcc</xbar.title>
# <xbar.version>v1.1</xbar.version>
# <xbar.author>naltatis</xbar.author>
# <xbar.author.github>naltatis</xbar.author.github>
# <xbar.desc>shows evcc solar charging stats</xbar.desc>
@surma
surma / importPolyfill.js
Created May 6, 2017 17:17
Polyfill for dynamic module loading
_registry = {};
importPolyfill = path => {
if(!(path in _registry)) {
const entry = _registry[path] = {};
entry.promise = new Promise(resolve => entry.resolve = resolve);
document.head.appendChild(Object.assign(
document.createElement('script'),
{
type: 'module',
innerText: `import * as X from '${path}'; _registry['${path}'].resolve(X);`,
@tzmartin
tzmartin / embedded-file-viewer.md
Last active May 1, 2024 14:41
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@alexis89x
alexis89x / broadcast-channel-es6.js
Last active February 21, 2024 16:56
Broadcast Channel API polyfill
/**
@class BroadcastChannel
A simple BroadcastChannel polyfill that works with all major browsers.
Please refer to the official MDN documentation of the Broadcast Channel API.
@see <a href="https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API">Broadcast Channel API on MDN</a>
@author Alessandro Piana
@version 0.0.6
*/
/*
@erotte
erotte / Kopfhörer
Last active December 16, 2015 00:09
Großer Kopfhörer-Vergleichstest in der Appfertigung!
Kopfhörer. Ich mag Kopfhörer.
Mit dem AKG K 240 MKII besitze ich schon einen ganz ordentliches Gerät. Ich benutze ihn gern am Fernseher oder am MacBook Pro und freue mich dabei immer sehr über das austauschbare Kabel. Ich mag auch den neutralen Charakter des K 240, auf Dauer fand ich ihn aber etwas langweilig.
Da ich mich bei der Arbeit am Rechner mit einem "Gehörschutz" besser konzentrieren kann, sollte ein geschlossener Kopfhörer her, der Spass macht und weniger neutral sein darf.
Der Kopfhörer sollte also:
* Am Laptop funktionieren, also niederohmig sein bzw. eine hohe Empfindlichkeit besitzen
* Gerne einen Badewannen-Frequenzgang haben und kräftige, klare Bässe wiedergeben. Spass geht vor Neutralität und Genauigkeit.
* Gut sitzen, damit ich ihn ggf. mehrere Stunden ohne Unterbrechung tragen kann
* Geschlossen sein, um Aussengeräusche abzuschirmen
@bnoordhuis
bnoordhuis / http-and-https-proxy.js
Created February 8, 2013 16:31
A node.js proxy that accepts HTTP and HTTPS traffic on the same port.
var fs = require('fs');
var net = require('net');
var http = require('http');
var https = require('https');
var httpAddress = '/path/to/http.sock';
var httpsAddress = '/path/to/https.sock';
fs.unlinkSync(httpAddress);
fs.unlinkSync(httpsAddress);
@simX
simX / hidpi.txt
Created July 28, 2012 04:58
Enable HiDPI mode in Mountain Lion w/o Quartz Debug
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES;
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled;
// by the way, you need to logout and log back in for this to take effect. Or at least that's what
// Quartz Debug says. Who knows, maybe it's lying?
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from.
@LeaVerou
LeaVerou / dabblet.css
Created April 22, 2012 09:19 — forked from kizu/dabblet.css
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
@FGRibreau
FGRibreau / pid.js
Created February 16, 2012 18:41
Simple snippet for cross-platform .pid management in NodeJS. I use it for managing NodeJS apps with supervisord and monit
//
// Usage: require('./pid')("myapp");
//
var fs = require('fs');
module.exports = function(appname){
process.title = appname;
var PID_FILE = "/usr/local/var/run/"+process.title+".pid";