Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Working...

Attila Kerekes keriati

👨‍💻
Working...
View GitHub Profile
@keriati
keriati / github-keybindings.js
Created May 24, 2018
Keybindings / shortcuts for Github Enterprise for faster code reviews in pull requests
View github-keybindings.js
// ==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
Keybindings for Hacker news for tampermonkey
View hackernews-keybindings.js
// ==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==
View .zshrc.sh
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 Mar 25, 2014
$.ajax upload progress event callback support
View ajaxSetup.js
(function () {
// support for uploadProgress callback
var originalXHR = $.ajaxSettings.xhr;
$.ajaxSetup({
xhr: function () {
var myXHR = originalXHR();
if (myXHR.hasOwnProperty('upload') && this.hasOwnProperty('uploadProgress')) {
View callbackhell.js
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 Aug 29, 2015
Callback hell solutions
View callbackhell.js
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 Aug 29, 2015
wienerz bootstrap config
View config.json
{
"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 Sep 2, 2013
Youtube "large" mode bookmark for every screen size
View watch-large.js
javascript: (function() {var vid = document.getElementById('player'); vid.className = vid.className + " watch-large";})()
@keriati
keriati / inherigame.html
Last active Dec 14, 2015
Prototypal Inheritance in JavaScript
View inherigame.html
<!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 Dec 13, 2015
Test of the encoding and decoding function found in fliphole.php
View encodeDecode.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) {
You can’t perform that action at this time.