Skip to content

Instantly share code, notes, and snippets.

@falvhb
Created June 23, 2017 12:10
Show Gist options
  • Save falvhb/544cb87b608a9f05bd179855c3e22871 to your computer and use it in GitHub Desktop.
Save falvhb/544cb87b608a9f05bd179855c3e22871 to your computer and use it in GitHub Desktop.
Glitch Live Reload
function start(){
$('.CodeMirror')[0].CodeMirror.options.extraKeys['Ctrl-S'] = function(){$.get('https://edison.glitch.me/reload')};
}
function check(){
if ($ && $('.CodeMirror') && $('.CodeMirror')[0] && $('.CodeMirror')[0].CodeMirror){
console.log('starting...');
start();
} else {
console.log('waiting...');
setTimeout(check, 100);
}
}
check();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment