Skip to content

Instantly share code, notes, and snippets.


Gautam Singh gtmsingh

View GitHub Profile
View typeracer.hack.js
function triggerKeyboardEvent(el, keyCode, type)
var eventObj = document.createEventObject ?
document.createEventObject() : document.createEvent("Events");
eventObj.initEvent(type, true, true);
eventObj.keyCode = keyCode;
carlsmith /
Created Apr 5, 2017
A Python function that does multiple string replace ops in a single pass.
import re
def replace(string, substitutions):
substrings = sorted(substitutions, key=len, reverse=True)
regex = re.compile('|'.join(map(re.escape, substrings)))
return regex.sub(lambda match: substitutions[], string)
mobilemind /
Last active Mar 5, 2021
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName