Skip to content

Instantly share code, notes, and snippets.

@urielha
urielha / .tmux.conf
Last active February 12, 2024 09:16
Home Directory rc files
# re-bind prefix command to `
unbind C-b
set -g prefix `
bind ` send-prefix
# Shortcat to synchronize panes
bind e setw synchronize-panes on
bind E setw synchronize-panes off
# Bind ctrl+k for clear buffer
@urielha
urielha / measuretime.py
Last active June 4, 2018 16:42
Measure time pytho decorator - for measuring runtime of a any function easily
from functools import wraps
from time import time
from datetime import datetime
# Python 3
def measure(method):
@wraps(method)
def wrapper(*args, **kwargs):
mname = method.__name__
s = time()
[mergetool "vsmerge"]
path = C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/vsDiffMerge.exe
cmd = \"C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/vsDiffMerge.exe\" /m \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
trustExitCode = false
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
[mergetool "vscode"]
cmd = code --wait $MERGED
[mergetool "kdiff3"]
@urielha
urielha / calculator.py
Last active November 12, 2017 00:52
Python Calculator line parser recursive
class Calculator():
def __init__(self, s):
self._s = s
self._i = 0
self._len = len(s)
self._err = False
def next(self):
self._i += 1
@urielha
urielha / template.json
Created June 5, 2016 12:12
Elastic sample template with _ttl
{
"template": "index_name_with_joker_*",
"settings": {
"indices.ttl.interval": "8h",
"index.ttl.interval": "8h"
},
"mappings": {
"LogEventType": {
"_timestamp": {
"enabled": true,