Skip to content

Instantly share code, notes, and snippets.

@serthy
serthy / tex.bat
Last active August 29, 2015 14:07
:: sumatrapdf.exe is in miktex/miktex/bin
:: biber.exe in miktex/miktex/bin
:: sumatrapdf: einstellungen > optionen : 'pfad/zu/sublime_text.exe %f:%l:100000' eintragen
:: call this batch file like: 'tex.bat myTexFile' (myTexFile without any extension)
@echo off
setlocal
set document=%~n1
@serthy
serthy / gist:5c47ddcc63ff58ebc42e
Last active August 29, 2015 14:06
Sublime: show snippets on alt+s
{
"keys":
[
"alt+s"
] ,
"command": "show_overlay" ,
"args":
{
"overlay": "command_palette" ,
"text": "Snippet: ELi: " ,
@serthy
serthy / camelCase2snake_case.py
Last active August 29, 2015 14:05
camelCase2snake_case
# http://stackoverflow.com/questions/21169792/python-function-to-convert-camel-case-to-snake-case
# http://stackoverflow.com/questions/1175208/elegant-python-function-to-convert-camelcase-to-camel-case
def snake_case( string ):
import re
string = re.sub( '$(.)([A-Z](?!s[A-Z])[a-z]+)', r'\1_\2' , string )
string = re.sub( '$(.)([0-9]+)', r'\1_\2', string )
string = re.sub( '([a-z0-9])([A-Z])', r'\1_\2' , string )
string = string.lower().replace( '__' , '_' )
return string