Skip to content

Instantly share code, notes, and snippets.

View h8every1's full-sized avatar

Anton Syuvaev h8every1

View GitHub Profile
@h8every1
h8every1 / h8every1.zsh-theme
Created December 18, 2019 20:27
oh-my-zsh theme with full path and simple git status
local ret_status="%(?:%{$fg_bold[green]%}%#> :%{$fg_bold[red]%}%#> )%{$reset_color%}"
NEWLINE=$'\n'
PROMPT='%{$fg_bold[green]%}[%{$fg[cyan]%}%d%{$fg_bold[green]%}]%{$reset_color%} $(git_prompt_info)${NEWLINE}${ret_status}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[red]%}(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[red]%}) %{$fg[green]%}✔︎"
@h8every1
h8every1 / replace_first_occurrence.sql
Created April 4, 2018 15:06
MySQL - replace first occurrence of string in column
set @oldString = 'http://'; -- string to replace
set @newString = ''; -- string to replace with
UPDATE table_name
set column_name =
IF(
INSTR(column_name, @oldString) <> 0,
CONCAT(
REPLACE(
LEFT(column_name, INSTR(column_name, @oldString) - 1), @oldString, @newString