Skip to content

Instantly share code, notes, and snippets.

View linkesch's full-sized avatar

Pavel Linkesch linkesch

View GitHub Profile
@linkesch
linkesch / maker-enhance-example.js
Created January 20, 2022 10:02
Maker enhance integration example
import React from 'react';
import MakerEnhance from 'maker-enhance';
export default function Content() {
return (
<div>
<MakerEnhance user="[user]" index="header" />
<MakerEnhance user="[user]" index="main" />
</div>
);
@linkesch
linkesch / maker-enhance.js
Created January 20, 2022 09:54
Maker enhance integration
import MakerEnhance from 'maker-enhance';
<MakerEnhance user="[user]" />
@linkesch
linkesch / maker-integration-div.html
Created January 20, 2022 09:26
Maker integration
<div
class="js-maker-enhance-static-mount"
id="js-maker-static-enhance-v1-e97676d8-29d5-11eb-adc1-0242ac120002"
style="height: auto; width: 100%;"
></div>
@linkesch
linkesch / maker-integration.html
Last active January 20, 2022 09:22
Maker integration
<link rel="preload" href="https://app.maker.co/enhance/[user].js" as="script">
<script type="text/javascript">!(function(){var e={enhanceId:'[user]',
enhanceTimeout:4e3},t=document.getElementById('js-maker-enhance-style'),
n=setTimeout(function(){t&&t.parentElement.removeChild(t),(window
.mk_enhance_timeout=!0)},e.enhanceTimeout),a=!1,c=document
.createElement('script'),f=window.location.search
.match(/mk_experience_preview/)?'?_t='+new Date().getTime():'';(c.src=
'https://app.maker.co/enhance/'+e.enhanceId+'.js'+f),(c.type=
'text/javascript'),(c.async='true'),(c.onload=c.onreadystatechange=
function(){var e=this.readyState;a||(e&&'complete'!=e&&'loaded'!=e)||((
@linkesch
linkesch / isValidProperty.js
Created June 18, 2019 10:36
Check if a property is a valid CSS property
function isValidProperty(property, value) {
const tmp = document.createElement('div');
tmp.style.setProperty(property, value);
return Boolean(tmp.style.getPropertyValue(property));
}
@linkesch
linkesch / node-gyp-error.sh
Created April 3, 2018 18:41
Error: Cannot find module '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js'
# https://github.com/nodejs/node-gyp/issues/809#issuecomment-343288691
# After switching to a new NodeJS version using n I got this issue as well (I usually do when switching versions...)
# This did the trick for me:
npm explore npm -g -- npm install node-gyp@latest
@linkesch
linkesch / remove-old-branches.sh
Created February 10, 2018 17:45
Git tip: Have a lot of old branches on your machine? Here's a Bash script that removes local branches that are no longer remote: https://twitter.com/housecor/status/961942463006027776
git fetch -p && for branch in `git branch -vv --no-color | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done
@linkesch
linkesch / es6-class-mixin.js
Last active February 7, 2018 20:43
ES6 class mixin
export default Superclass => class extends Superclass {
constructor(...args) {
super(...args);
}
};
@linkesch
linkesch / gist:a408169ca5edd23f5357949e2eaef016
Created February 17, 2017 10:20
Delete git .orig files
# http://stackoverflow.com/a/20895666/291500
find . -name '*.orig' -delete
@linkesch
linkesch / steps.md
Created September 27, 2016 07:43
Fix vagrant not mounting shared folder