Skip to content

Instantly share code, notes, and snippets.

View MiniXC's full-sized avatar
🏠
Working from home

Christoph Minixhofer MiniXC

🏠
Working from home
  • Edinburgh
View GitHub Profile
@MiniXC
MiniXC / attributeeditable.js
Last active January 4, 2017 20:46
Makes attributes with the attributeeditable attribute editable. Demo: http://codepen.io/MiniXC/pen/mOXqyP
let observer = new MutationObserver(mutations => {
mutations.forEach(mutation => {
if(mutation.attributeName === "attributeeditable") {
if(mutation.target.hasAttribute("attributeeditable") && mutation.target.getAttribute("attributeeditable") !== 'false') {
createPopovers();
} else {
editAttributes(mutation.target);
mutation.target.removeAttribute("data-attributeeditable");
}
}
@MiniXC
MiniXC / clip-path-polyfill.js
Last active May 2, 2016 13:55
Clip-Path Polyfill: Only works for "clip-path: inset" and absolute/fixed elements. Depends on polyfill.js (https://philipwalton.github.io/polyfill).
/*
* Dependends on: https://philipwalton.github.io/polyfill
* Only works for:
* -> clip-path: inset
* -> absolute/fixed positioned elements
*/
function ClipPath() {
var rectVals, rectElements, //read by setRectOnElements, set by init
polyfill = new Polyfill({
@MiniXC
MiniXC / vagrant-stdin-fixes.sh
Created July 20, 2015 10:51
vagrant-stdin-fixes
# fixes "default: stdin: is not a tty" error message
# source: http://foo-o-rama.com/vagrant--stdin-is-not-a-tty--fix.html
s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile"
# fixes "dpkg-reconfigure: unable to re-open stdin: No file or directory" error message
# source: http://serverfault.com/a/500778
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8