Skip to content

Instantly share code, notes, and snippets.

View logicalgroove's full-sized avatar
🇺🇦

Alex Lopez logicalgroove

🇺🇦
  • VA
View GitHub Profile
@logicalgroove
logicalgroove / sproc_bench.rb
Last active December 8, 2023 23:18
SPROC benchmark
# Prerequisite:
# gem install tiny_tds
require 'tiny_tds'
require 'benchmark'
# Database connection parameters
server = 'your_server'
database = 'your_database'
username = 'your_username'
@logicalgroove
logicalgroove / setup_tmux_session.sh
Last active January 3, 2024 02:08
Tmux sessions helper
# setup_tmux_session.sh
# chmod +x setup_tmux_session.sh
# Usage: ./setup_tmux_session.sh SESSION_NAME FOLDER_PATH
SESSION_NAME=$1
FOLDER_PATH=$2
# Check if the session exists
tmux has-session -t "$SESSION_NAME" 2>/dev/null
@logicalgroove
logicalgroove / screen_typer.scpt
Created February 19, 2023 23:00
screen_typer.scpt
on run {input, parameters}
activate application "iTerm"
tell application "iTerm"
tell current tab of current window
set theString to "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
tell application "System Events"
repeat with thisChar in theString
keystroke thisChar
delay 0.03
end repeat
# Git Shortcuts
alias gs='git status'
alias gst='git status -sb'
alias ga='git add'
alias gau='git add -u' # Removes deleted files
alias gp='git pull'
alias gh='git push'
alias gc='git commit -v'
alias gca='git commit -v -a' # Does both add and commit in same command, add -m 'blah' for comment
alias go='git checkout'

Open browser with jira ticket from spotlight.

(For MAC only, for now)

I found this easy way to lunch a ticket in the browser from spotlight.

AppleScript version (recommended)

Compiled script as app can be downloaded here.

<!DOCTYPE html>
<head>
<title>HTML5 Camera Fun</title>
</head>
<style type="text/css">
.crop-canvas {
bottom: -30px;
@logicalgroove
logicalgroove / useful_commands.md
Last active September 2, 2020 15:19
Useful commands

Vim

Remove ^M

%s/\r//g

Remove unwanted whitespaces

:%s/\s\+$//
@logicalgroove
logicalgroove / gist:1109202
Created July 27, 2011 11:53
Регулярное выражение для нахождения дмена из линки на статю
article.link.match(/([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}/)