Skip to content

Instantly share code, notes, and snippets.

@ivanhub
ivanhub / Access-Control-Allow-Origin.example.htaccess
Created November 23, 2017 07:15
Access-Control-Allow-Origin
<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
Header set Access-Control-Allow-Origin "https://Domain.Com"
</FilesMatch>
@ivanhub
ivanhub / 6G-Firewall.htaccess
Created November 23, 2017 07:17
htaccess 6G-Firewall
# 6G FIREWALL/BLACKLIST
# @ https://perishablepress.com/6g/
# 6G:[REQUEST METHOD]
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_METHOD} ^(connect|debug|move|put|trace|track) [NC]
RewriteRule .* - [F]
</IfModule>
# 6G:[REFERRERS]
@ivanhub
ivanhub / Excel-VBA-Date-Highlight.vba
Created November 24, 2017 12:36
Excel-VBA-Date-Highlight
' Highlight cells by Date:
' CellDate > TodayDate + 5d -> White
' CelDate + 5d => TodayDate >= CellDate -> Yellow
' TodayDate >= CellDate + 5d -> Red
Sub ShowForm()
Dim i As Integer
N = Range("N" & 1).Column
O = Range("O" & 1).Column
@ivanhub
ivanhub / git_newrepo
Created December 7, 2017 07:37 — forked from c0ldlimit/git_newrepo
Git: Push a new or existing repo to Github
# Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/c0ldlimit/vimcolors.git
git push -u origin master
# Push an existing repository from the command line
@ivanhub
ivanhub / gitignore.sh
Last active December 7, 2017 08:27
Remove files which are not in the .gitignore
#1
git rm --cached `git ls-files -i --exclude-from=.gitignore`
for windows:
git ls-files -i --exclude-from=.gitignore | xargs git rm --cached
#2
git rm -r --cached .
@ivanhub
ivanhub / gitremoteadd.sh
Created December 7, 2017 08:34
My Git Remote Add-Url
git remote add origin git+ssh://git@github.com/ivanhub/
@ivanhub
ivanhub / reword-first-commit.git.sh
Created December 12, 2017 06:29
Reword first git commit
#reword first commit
git rebase -i --root
@ivanhub
ivanhub / git-config-cache-timeout.sh
Created December 21, 2017 09:43
git config cache timeout
git config --global credential.helper 'cache --timeout=3600'
@ivanhub
ivanhub / wp-crontab-ipgeobase-update.cron
Created December 22, 2017 07:45
WP cron tab php (update ip geo base)
file_put_contents("cities.tar.gz", fopen("http://ipgeobase.ru/files/db/Main/geo_files.tar.gz", 'r'));
$p = new PharData('cities.tar.gz');
$p->decompress();
$phar = new PharData('cities.tar');
unlink('/home/r/rosakaderf/samarapb.ru/public_html/wp-content/themes/atahualpa/cities.txt');
unlink('/home/r/rosakaderf/samarapb.ru/public_html/wp-content/themes/atahualpa/cidr_optim.txt');
$phar->extractTo('/home/r/rosakaderf/samarapb.ru/public_html/wp-content/themes/atahualpa/');
$text = file_get_contents('/home/r/rosakaderf/samarapb.ru/public_html/wp-content/themes/atahualpa/cities.txt');
$text2 = iconv('WINDOWS-1251', 'UTF-8', $text);
//$text3 = file_get_contents('/home/spb8hot/public_html/wp-content/themes/atahualpa/cidr_optim.txt');
@ivanhub
ivanhub / jsfiddle.net-save-to-file.txt
Created December 22, 2017 09:41
Save JSFiddle.net to one file
#
# Save jsfiddle.net to one file.
#
view-source:http://fiddle.jshell.net/<fiddle_id>/show/light/