Skip to content

Instantly share code, notes, and snippets.

View jeremija's full-sized avatar

Jerko Steiner jeremija

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jeremija on github.
  • I am steiner (https://keybase.io/steiner) on keybase.
  • I have a public key whose fingerprint is 3839 4E6E 8C90 78C2 4F6A 221A DD8C 9510 EE19 F834

To claim this, I am signing this object:

@jeremija
jeremija / resize.sh
Created September 17, 2014 18:12
Resize with watermark
#!/bin/bash
# author jsteiner
#
# Resizes an image and adds a watermark. To customize which watermark is added,
# edit the $WATERMARK variable below.
#
DIR=`dirname "$BASH_SOURCE"`
WATERMARK="$DIR/watermark.png"
SRC="$1"
@jeremija
jeremija / log-test.js
Created September 23, 2014 21:47
AMD module for logging
define(['Squire'], function(Squire) {
'use strict';
var injector = new Squire();
var logArgs, warnArgs, errorArgs,
logThis, warnThis, errorThis;
var win = {
'Function': {
'prototype': {
@jeremija
jeremija / rtree.js
Last active August 29, 2015 14:06 — forked from dustinboston/rtree.js
// Usage:
//
// 1. Put this in the file that gets first loaded by RequireJS
// 2. Once the page has loaded, type window.rtree.map() in the console
// This will map all dependencies in the window.rtree.tree object
// 3. To generate UML call window.rtree.toUml(). The output can be used
// here: http://yuml.me/diagram/scruffy/class/draw
requirejs.onResourceLoad = function (context, map, depMaps) {
if (!window.rtree) {
window.rtree = {};
@jeremija
jeremija / auto-update-script.sh
Last active August 29, 2015 14:06
update applications on the server and restart the service without the prompts
#!/bin/bash
# Copies file to the server and restarts a service on the server. If you have uploaded
# your public ssh key to the server, you should be able to run this without any prompts.
#
# If your private ssh key is password protected, consider using ssh-add to avoid being
# prompted for password every time.
#
# author jsteiner
host=marsh
@jeremija
jeremija / JSHint.sublime-build
Created November 11, 2014 13:57
ST3 - JSHint package fix for wrong line numbers selected with F4 when TAB indentation is used
{
"selector": "source.js",
// only the following is added: "$packages/JSHint/jshintrc", "$file"
// compared to: https://github.com/uipoet/sublime-jshint/blob/master/JSHint.sublime-build
"cmd": ["jshint", "--config", "$packages/JSHint/jshintrc", "$file", "--reporter", "$packages/JSHint/reporter.js"],
"file_regex": "JSHint: (.+)\\]",
"line_regex": "(\\d+),(\\d+): (.*)$",
@jeremija
jeremija / MakeMochaPhantomJS.py
Last active August 29, 2015 14:09
Sublime Text - MakeMochaPhantomJS.py command
import os
#import sublime
import sublime_plugin
class MochaCommand(sublime_plugin.WindowCommand):
def _run_test(self, project_path, filepath, test_gen, grep):
args = {
@jeremija
jeremija / config
Last active August 29, 2015 14:10
i3 config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@jeremija
jeremija / mnt
Last active August 29, 2015 14:11
Mount devices by labels
#!/usr/bin/env python3
import argparse
import subprocess
import os
import sys
parser = argparse.ArgumentParser()
LABELS_PATH = '/dev/disk/by-label'
@jeremija
jeremija / muxtitles.py
Last active August 29, 2015 14:12
muxtitles
#!/usr/bin/env python3
#
# Uses subdl to download video subtitles and muxes it to a new mkv video. The only requirement is for the video is to
# be mkv-compatible.
#
# You can find the subdl here: https://github.com/akexakex/subdl/blob/master/subdl
#
# If you use xfce4/thunar, custom actions can be added for *.mp4 and *.mkv video files:
#
# xfce4-terminal --hold --execute /usr/local/bin/muxtitles %F