Skip to content

Instantly share code, notes, and snippets.

View robin-drexler's full-sized avatar
👋
I may be slow to respond.

Robin Drexler robin-drexler

👋
I may be slow to respond.
View GitHub Profile
@robin-drexler
robin-drexler / test
Last active August 29, 2015 14:07
test
testrsfsd
https://twitter.com/soulstewmartin/status/530765744204951553
> Der Song zur #gewinnsession: What Have I Done To Deserve This http://youtu.be/Wn9E5i7l-Eg
https://twitter.com/ThYpHoOn/status/530764562501742593
>
@robin-drexler
robin-drexler / gist:a0c460a359569a2cd117
Created December 10, 2014 19:12
[TIL]Checkout previous git branch
git co -
window.addEventListener("keydown", function(e) {
e.preventDefault(); // seems to be sufficient to prevent most default shortcuts
// do something, e.g. custom save
});
@robin-drexler
robin-drexler / dom_dispatch_phases_example.js
Last active August 29, 2015 14:24
dom dispatch phases
function listen(){};
// register for capture phase
// 3rd param useCapture is set to true
someDomElement.addEventListener('click', listen, true);
// register for bubble phase
// 3rd param useCapture is set to false (default)
someDomElement.addEventListener('click', listen, false);
<html>
<body>
<span>LocalStorage: </span>
<span id="localstorage-info" style="font-weight: bold"></span>
<script type="text/javascript">
var localStorageInfoElement = document.querySelector('#localstorage-info')
try {
window.localStorage.setItem('moep', true);
localStorageInfoElement.textContent = 'Yep! :)';
var dog = {
get age () {
console.log('accessed age');
return this._age;
},
set age (age) {
console.log('set age');
this._age = age;
}
};
@robin-drexler
robin-drexler / livetemplate.xml
Created March 1, 2017 21:07
explicit return arrow function livetemplate
<template name="exret" value="{&#10; $END$&#10; return $SELECTION$&#10;}" description="explicit return" toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_SCRIPT" value="true" />
</context>
</template>
const puppeteer = require('puppeteer');
const queries = require('dom-testing-library/dist/queries');
const fs = require('fs');
async function createHelpers(page) {
await page.evaluateOnNewDocument(
fs.readFileSync(
'./node_modules/dom-testing-library/dist/dom-testing-library.umd.js',
'utf8'
)
@robin-drexler
robin-drexler / cla.md
Last active January 23, 2019 07:27
cla test

CLA

hello