Skip to content

Instantly share code, notes, and snippets.

@neiser
neiser / conventional-commit-regex-for-gitlab.yml
Last active March 27, 2025 13:58
Conventional Commit Regex for GitLab Push Rule
# The regex is split into a YAML sequence for better commenting
# Use
# yq 'join("")' conventional-commit-regex.yml
# to get the actual regex string!
# Test changes using
# https://regex101.com/r/tl6h3n/6 (please update this if you make some changes below)
# See also https://docs.gitlab.com/user/project/repository/push_rules/#validate-commit-messages
# In particular, note that GitLab uses multiline mode by default, so use \A, \z instead of ^ or $
@SleepWalker
SleepWalker / swipe.js
Created September 30, 2015 04:59
A simple swipe detection on vanilla js
var touchstartX = 0;
var touchstartY = 0;
var touchendX = 0;
var touchendY = 0;
var gesuredZone = document.getElementById('gesuredZone');
gesuredZone.addEventListener('touchstart', function(event) {
touchstartX = event.screenX;
touchstartY = event.screenY;
@localpcguy
localpcguy / swipeFunc.js
Created November 17, 2011 16:00
Simple Mobile Swipe function to get the swipe direction
var swipeFunc = {
touches : {
"touchstart": {"x":-1, "y":-1},
"touchmove" : {"x":-1, "y":-1},
"touchend" : false,
"direction" : "undetermined"
},
touchHandler: function(event) {
var touch;
if (typeof event !== 'undefined'){