This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .bashrc | |
# | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc | |
fi | |
# Uncomment the following line if you don't like systemctl's auto-paging feature: | |
# export SYSTEMD_PAGER= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Place it to .git/hooks/commit-msg and chmod +x .git/hooks/commit-msg | |
# Automatically adds branch name and branch description to every commit message. | |
# | |
NAME=$(git branch | grep '*' | sed 's/* //') | |
DESCRIPTION=$(git config branch."$NAME".description) | |
echo "$NAME"'/'$(cat "$1") > "$1" | |
if [ -n "$DESCRIPTION" ] | |
then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i3-msg exec "scrot -s selected_area_screen.png && cat selected_area_screen.png | xclip -selection clipboard -t image/png -i" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .bashrc | |
# ~/.bashrc file | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc | |
fi | |
# Uncomment the following line if you don't like systemctl's auto-paging feature: | |
# export SYSTEMD_PAGER= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PS1=\[\033[1;37m\]\w(\D{%T})\[\033[33m\]$(gb)\[\033[00m\]$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bindsym $mod+Shift+h exec i3lock -i gitp.pb.pngng -t -p default -n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xrandr --output VGA1 --right-of HDMI1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###File name is free_m | |
mem_free() | |
{ | |
TYPE=free | |
awk -v type=$TYPE ' | |
/^MemTotal:/ { | |
mem_total=$2 | |
} | |
/^MemFree:/ { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$str = '11000000000000000000000 33'; | |
//echo 11000000000000000000000+33 will produce 1.1E+22983411000000000000000000030 | |
//but with this code you will get 11000000000000000000033 | |
$e = explode(" ", $str); | |
$num1 = $e[0]; | |
$num2 = $e[1]; | |
//100 | |
// 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Cop wp-login.php into any_login_admin_page.php | |
//then delete wp-login.php | |
//then write this... | |
add_filter('login_url', function($login_url, $redirect = '', $force_reauth = false) { | |
$login_url = site_url( '/any_login_admin_page.php', 'login' ); | |
if ( ! empty( $redirect ) ) { | |
$login_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $login_url ); | |
} | |
if ( $force_reauth ) { | |
$login_url = add_query_arg( 'reauth', '1', $login_url ); |
NewerOlder