Skip to content

Instantly share code, notes, and snippets.

@yuraloginoff
yuraloginoff / .nanorc
Last active June 6, 2020 11:03
#linux: .nanorc for nano v. 4.9.3
## Sample initialization file for GNU nano.
##
## VERSION 4.9.3
##
## Characters that are special in a shell should not be escaped here.
## Inside string parameters, quotes should not be escaped -- the last
## double quote on the line will be seen as the closing quote.
##
## For the options that take parameters, the default value is shown.
## Other options are unset by default. To make sure that an option
@yuraloginoff
yuraloginoff / .zshrc
Last active June 6, 2020 11:07
#linux:.zshrc
ZSH_THEME="avit"
plugins=(npm extract vscode web-search z)
#################
# #
# ALIASES #
# #
#################
@yuraloginoff
yuraloginoff / firefox-only.css
Last active June 6, 2020 11:18
#css firefox-only
@-moz-document url-prefix() {}
@yuraloginoff
yuraloginoff / css grayscale
Last active June 6, 2020 11:18
#css: grayscale
.grayscale {
-webkit-filter: grayscale(1);
filter: grayscale(1);
}
@yuraloginoff
yuraloginoff / SHA256 Checksum
Last active June 6, 2020 11:20
#linux: SHA256 Checksum in Bash
$ shasum -a 256 FILENAME | awk '$1 == "SHA256 HASH" { print "good to go" }'
function interval(func, wait, times){
var interv = function(w, t){
return function(){
if(typeof t === "undefined" || t-- > 0){
setTimeout(interv, w);
try{
func.call(null);
}
catch(e){
t = 0;
@yuraloginoff
yuraloginoff / gist:6b169abd595848a71b2e
Last active June 6, 2020 11:24
Responsive layout PHP for loop
<div class="row">
<?php for ($i = 0; $i < count($news); $i++) { ?>
<?php if ($i == 0 ) {
echo '<div class="row">';
} else if ($i != 0 && $i % 4 == 0) {
echo '</div><div class="row">';
} ?>
<?php if ($i == (count($news)-1) && count($news) % 4 != 0) {
@yuraloginoff
yuraloginoff / Colorful Bash Prompt
Last active June 6, 2020 11:27 — forked from trinne/Colorful Bash Prompt
#bash: Colorful Bash Prompt
# Colorful Bash Prompt, inspired by "Extravagant Zsh Prompt"
# Screenshot: http://img.gf3.ca/d54942f474256ec26a49893681c49b5a.png
# A big thanks to \amethyst on Freenode
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color
fi
if tput setaf 1 &> /dev/null; then
tput sgr0
@yuraloginoff
yuraloginoff / .bashrc
Last active June 6, 2020 11:28
#bash: Customizing Bash environment and setup environment variables
#
# Customizing Bash environment
#
# Correct dir spellings
shopt -q -s cdspell
# Make sure display get updated when terminal window get resized
shopt -q -s checkwinsize
@yuraloginoff
yuraloginoff / input.sh
Last active June 6, 2020 11:31
#bash: Handling Input
#!/bin/bash
read -p "Enter your name : " name
echo "Hi, $name. Let us be friends!"
# read three numbers and assigned them to 3 vars
read -p "Enter number one : " n1
read -p "Enter number two : " n2
read -p "Enter number three : " n3