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 / 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 / ajaxSetup.js
Created March 25, 2014 10:42
$.ajax upload progress event callback support
(function () {
// support for uploadProgress callback
var originalXHR = $.ajaxSettings.xhr;
$.ajaxSetup({
xhr: function () {
var myXHR = originalXHR();
if (myXHR.hasOwnProperty('upload') && this.hasOwnProperty('uploadProgress')) {
var AwesomeObject = function() {
this.init()
};
AwesomeObject.prototype = {
init: function() {
_.bindAll(this, 'onSuccess', 'onError', 'onComplete')
// or
this.onSuccess = $.proxy(this.onSuccess, this)
@keriati
keriati / callbackhell.js
Last active August 29, 2015 13:57
Callback hell solutions
var AwesomeObject = function() {};
AwesomeObject.prototype = {
doSomeThingAsync: function() {
var that = this;
// Do that with bind?
return asyncThing({
success: function() { that.onSuccess.apply(that, arguments);},
@keriati
keriati / config.json
Last active August 29, 2015 13:57
wienerz bootstrap config
{
"vars": {
"@gray-darker": "#000",
"@gray-dark": "#1a171b",
"@gray": "lighten(@gray-dark, 33.5%)",
"@gray-light": "lighten(@gray-dark, 60%)",
"@gray-lighter": "lighten(@gray-dark, 93.5%)",
"@brand-primary": "#df0b25",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",
@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') {