Skip to content

Instantly share code, notes, and snippets.

View keriati's full-sized avatar
👨‍💻
Working...

Attila Kerekes keriati

👨‍💻
Working...
View GitHub Profile
@keriati
keriati / test.html
Created August 12, 2012 19:31
Detect invalid characters
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.center {
text-align: center;
}
#myInput {
@keriati
keriati / jquery.draggable.js
Created July 30, 2012 12:11
Draggable without jQuery UI
(function($) {
$.fn.drags = function(opt) {
var $el;
opt = $.extend({handle: '', cursor: 'move', windowLock: true}, opt);
$el = ('' === opt.handle) ? this : this.find(opt.handle);
return $el
@keriati
keriati / git-list-todos.sh
Created September 30, 2022 11:09
List todos in codebase and git blame
git grep -ino "// TODO" | cut -d":" -f1-2 | sed 's/:/ /g' | sed 's/\(.*\) \(.*\)/\2,\2 \1/g' | xargs -r -L 1 git blame -c -L > todo-lol.txt
@keriati
keriati / github-keybindings.js
Created May 24, 2018 17:09
Keybindings / shortcuts for Github Enterprise for faster code reviews in pull requests
// ==UserScript==
// @name Github Enterprise Keyboard Shortcuts for Pull Requests
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Attila Kerekes
// @match https://github.url/*
// @grant none
// ==/UserScript==
@keriati
keriati / hackernews-keybindings.js
Last active May 23, 2018 15:37
Keybindings for Hacker news for tampermonkey
// ==UserScript==
// @name HackerNews Keyboard Shortcuts
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Adds j,k,o,c keybindings to navigate hackernews.
// @author Attila Kerekes
// @match https://news.ycombinator.com/news
// @grant none
// ==/UserScript==
gpr() {
NEWLINE=$'\n';
lastCommitMessage=$(git log -1 --pretty=%B);
ticketNumber=$(echo $lastCommitMessage | cut -d ":" -f2 | cut -d " " -f2);
message=$(<./.github/PULL_REQUEST_TEMPLATE.md);
messageReplaced=$(sed -e "s/GEOR-xxx/$ticketNumber/g" <<< $message);
hub pull-request -m "$lastCommitMessage$NEWLINE$messageReplaced" -o;
}
@keriati
keriati / watch-large.js
Created September 2, 2013 19:25
Youtube "large" mode bookmark for every screen size
javascript: (function() {var vid = document.getElementById('player'); vid.className = vid.className + " watch-large";})()
@keriati
keriati / inherigame.html
Last active December 14, 2015 11:39
Prototypal Inheritance in JavaScript
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
if (typeof Object.create === 'undefined') {
@keriati
keriati / encodeDecode.php
Last active December 13, 2015 16:49
Test of the encoding and decoding function found in fliphole.php
<?php
/**
* Encodes or Decodes some string
*
* @param string $string The string to encode or the string to decode
* @param string $secretkey The key to encode or decode with
*/
function encodeDecode($string, $secretkey) {
@keriati
keriati / addjquery.js
Created February 12, 2013 18:06
Bookmark content to add jQuery to current document. Put after "javascript:"
(function(){if(!window.jQuery){var s=document.createElement('script'), d = document.body;s.src='//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js';d.appendChild(s);}else{console.log('jQuery found!')}})();