Skip to content

Instantly share code, notes, and snippets.

Blaž krizajb

Block or report user

Report or block krizajb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@krizajb
krizajb / sidebar_gmail
Created May 13, 2018
Toggle gmail left sidebar with escape key
View sidebar_gmail
// ==UserScript==
// @name Toggle left sidebar
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Toggles left gmail sidebar on "esc" keypress.
// @author blaz.krizaj@gmail.com
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
// @match *://mail.google.com/*
// @grant none
// ==/UserScript==
@krizajb
krizajb / synology-diskstation-git-setup.md
Last active May 3, 2018 — forked from walkerjeffd/Synology-Diskstation-Git.md
Instructions for setting up git server on Synology Diskstation
View synology-diskstation-git-setup.md

Configure Synology NAS as Git Server

Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0.

Set Up User and Folder

  • Create user gituser via Diskstation interface (with File Station and WebDAV privilages)
  • Add new shared folder called git (located at /volume1/git) with read/write access for gituser and admin. This folder will hold all the repos.
  • Install Git Server package via Diskstation
@krizajb
krizajb / PGraphicsJava2DJustify.java
Last active Mar 6, 2018
Adds option to Justify text aligenment in processing.
View PGraphicsJava2DJustify.java
import processing.core.*;
public class PGraphicsJava2DJustify extends PGraphicsJava2D {
public static int JUSTIFY = 4;
static protected void showTextFontException(String method) {
throw new RuntimeException("Use textFont() before " + method + "()");
}
@krizajb
krizajb / gist:8fb2aacc68939d8b3dd3f7a1e2a3565b
Created Sep 18, 2017
Messure text/string in textfield
View gist:8fb2aacc68939d8b3dd3f7a1e2a3565b
public static function measureString(str:String, format:TextFormat) : Number {
var textField:TextField = new TextField();
textField.autoSize = TextFieldAutoSize.LEFT; // adjust appropriately
textField.defaultTextFormat = format;
textField.text = str;
return textField.textWidth;
}
You can’t perform that action at this time.