Skip to content

Instantly share code, notes, and snippets.

View jeremija's full-sized avatar

Jerko Steiner jeremija

View GitHub Profile
@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 / 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 / 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
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import java.beans.PropertyDescriptor;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
public class Jsr310SupportedBeanPropertyRowMapper<T> extends BeanPropertyRowMapper<T> {
@jeremija
jeremija / HibernateTest.java
Created February 2, 2015 21:55
Hibernate Test case
package test.hibernate;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
import org.hibernate.criterion.CriteriaSpecification;
import org.hibernate.criterion.Restrictions;
import org.hibernate.service.ServiceRegistry;
import org.junit.Before;
@jeremija
jeremija / 90-tp-compact-keyboard.rules
Last active April 6, 2023 09:26
Attempt to persistent bluetooth pairing (Thinkpad Bluetooth Keyboard with Trackpoint)
# udev rules to be placed in /etc/udev/rules.d
# this is from https://github.com/lentinj/tp-compact-keyboard
SUBSYSTEM=="input", \
ATTRS{name}=="ThinkPad Compact Bluetooth Keyboard with TrackPoint", \
RUN+="/etc/udev/scripts/tp-compact-keyboard --fn-lock-enable"
# this is my script
SUBSYSTEM=="input", \
ATTRS{name}=="ThinkPad Compact Bluetooth Keyboard with TrackPoint", \
@jeremija
jeremija / gist:54e44c382b15aff50f99
Created February 22, 2015 09:54
start fluidsynth midi server
fluidsynth --server --audio-driver=jack --connect-jack-outputs /usr/share/sounds/sf2/FluidR3_GM.sf2
@jeremija
jeremija / update-sublime.sh
Last active August 29, 2015 14:17
Sublime Text automatic update script
#!/bin/bash
# Checks for a new version of Sublime Text and automatically downloads and
# extracts it.
#
# author: https://github.com/jeremija
SUBLIME_INSTALL_DIR="$HOME/opt/"
DOWNLOAD_LOC="/tmp/sublime.tar.bz2"
CURRENT_VERSION=$(sublime --version | grep -o '[0-9]*')
URL=$(wget -O - -q https://www.sublimetext.com/3dev | grep -o 'http://[^"]*x64.tar.bz2')