Skip to content

Instantly share code, notes, and snippets.

View aorcsik's full-sized avatar

Antal Orcsik aorcsik

View GitHub Profile
@aorcsik
aorcsik / tmetric-charts.user.js
Last active May 20, 2017 09:11
TMetric - Projects Summary Chart - Tampermonkey Script
// ==UserScript==
// @name TMetric Charts
// @namespace http://aorcsik.com/
// @version 0.1
// @description Add animated bars to Projects Summary tables
// @author Antal Orcsik (http://aorcsik.com/)
// @match https://app.tmetric.com/*
// @grant none
// ==/UserScript==
@aorcsik
aorcsik / string-truncate.swift
Last active September 27, 2017 16:22
A little truncate function extension for the default String type
extension String {
/// Truncates the string to length number of characters and
/// appends optional trailing string if longer
func truncate(length: Int, trailing: String? = nil) -> String {
if countElements(self) > length {
return self.substringToIndex(advance(self.startIndex, length)) + (trailing ?? "")
} else {
return self
}
}
@aorcsik
aorcsik / af-magic2.zsh-theme
Last active August 29, 2015 14:08
My zsh theme
# af-magic2.zsh-theme
#
# Author: Antal Orcsik
# URL: http://aorcsik.com/
# Direct Link: https://gist.githubusercontent.com/aorcsik/c749f90bed0f885c4d0d/raw/af-magic2.zsh-theme
# Based on: Andy Fleming's af-magic theme
#
# Created on: July 17, 2014
# Last modified on: July 17, 2014

Keybase proof

I hereby claim:

  • I am aorcsik on github.
  • I am aorcsik (https://keybase.io/aorcsik) on keybase.
  • I have a public key whose fingerprint is D38D 74D3 79AA C164 6D28 0110 F11A 6066 8362 3EF3

To claim this, I am signing this object:

@aorcsik
aorcsik / gist:5011587
Last active December 14, 2015 02:09 — forked from gklka/gist:5011530
This is an augmented version of a small script from @gklka for correcting the beszeljukmac.com RSS.
<?php
if (isset($_GET['url'])) {
$url = $_GET['url'];
} else {
$url = "http://beszeljukmac.com/index.php/rss/hirek";
}
$page = file_get_contents($url);
if (function_exists("mb_convert_encoding")) {
@aorcsik
aorcsik / final_code.js
Created September 23, 2012 08:12
HTML5 Notifications
document.write('<input id="shownoti" style="display: none;" type="button" value="Show Notification" />');
document.write('<div style="display: none;" id="notidenied">Az értesítések megjelenítését letiltottad!</div>');
var displayNotiButton = function() {
if (window.webkitNotifications.checkPermission() == 0) {
document.getElementById("shownoti").onclick = function() {
var notification = webkitNotifications.createNotification("icon.png", "blog.intiweb.hu", "Értesítve vagy!");
notification.addEventListener('display', function() {
window.setTimeout(function() {
notification.cancel();
}, 5000);