Skip to content

Instantly share code, notes, and snippets.

@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 / reword-first-commit.git.sh
Created December 12, 2017 06:29
Reword first git commit
#reword first commit
git rebase -i --root
@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 / 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 / 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 / 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 / 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 / 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 / Strict-Transport-Security.htaccess
Created November 23, 2017 07:14
Strict-Transport-Security
Simple:
Header set Strict-Transport-Security "max-age=31536000" env=HTTPS
With Preload:
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" env=HTTPS
@ivanhub
ivanhub / meta-CSR.example
Created November 23, 2017 07:13
Content-Security-Policy
<meta http-equiv="Content-Security-Policy" content="font-src 'self' *.ros.academy fonts.gstatic.com fonts.googleapis.com; style-src 'self' 'unsafe-inline' fonts.googleapis.com maxcdn.bootstrapcdn.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' www.googleadservices.com www.google-analytics.com mc.yandex.ru *.ros.academy www.google-analytics.com apis.google.com connect.facebook.net connect.ok.ru ajax.googleapis.com api-maps.yandex.ru">