This file contains 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
function _r(maxlength){ | |
maxlength = (maxlength && typeof maxlength === 'number') ? maxlength : 20; | |
var result = []; | |
var template = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
template += "abcdefghijklmnopqrstuvwxyz"; | |
template += "0123456789"; | |
template += "`~!@#$%^&*()_+№;:?-="; | |
while(result.length < maxlength){ | |
var c = template.charAt(Math.floor(Math.random() * template.length)); |
This file contains 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/bash | |
echo "**=====font colors======**" | |
echo -e "\x1B[31m red \x1B[0m" | |
echo -e "\x1B[32m green \x1B[0m" | |
echo -e "\x1B[33m yellow \x1B[0m" | |
echo -e "\x1B[34m dark-blue \x1B[0m" | |
echo -e "\x1B[35m purple \x1B[0m" | |
echo -e "\x1B[36m light-blue \x1B[0m" | |
echo -e "\x1B[37m white \x1B[0m" |
This file contains 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
### Default text editor | |
export EDITOR=subl | |
# get current branch in git repo | |
function parse_git_branch() { | |
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` | |
if [ ! "${BRANCH}" == "" ] | |
then | |
STAT=`parse_git_dirty` | |
echo "[${BRANCH}${STAT}]" |
This file contains 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
1. Сгенерировать ключ с помощью PuttyGen | |
1.1. Сохранить private key в файл. | |
1.2. Скопировать публичный ключ в буфер обмена | |
2. Добавить скопированные публичный ключ в BitBucket (Manage Account -> SSH key) | |
3. Запустить PAgent и добавить приватный ключ. | |
4. Выполнить команду: plink git@bitbucket.org | |
4.1. На вопрос: Store key in cache? (y/n) ответить y |
This file contains 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 | |
branch=$(git rev-parse --abbrev-ref HEAD) | |
if [ "gh-pages" == "$branch" ]; then | |
exit | |
fi | |
echo Updating gh-pages for branch $branch | |
git checkout gh-pages | |
git checkout $branch -- dist |
This file contains 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
https://octodex.github.com/images/hanukkat.png | |
https://octodex.github.com/images/welcometocat.png | |
https://octodex.github.com/images/filmtocat.png | |
https://octodex.github.com/images/privateinvestocat.jpg | |
https://octodex.github.com/images/gracehoppertocat.jpg | |
https://octodex.github.com/images/gobbleotron.gif | |
https://octodex.github.com/images/jetpacktocat.png | |
https://octodex.github.com/images/minertocat.png | |
https://octodex.github.com/images/mountietocat.png | |
https://octodex.github.com/images/saketocat.png |
This file contains 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
// 1. Переходим на свою страницу в ВК | |
// 2. Зажимаем пробел и ждем, пока лента прокрутится до нужных постов или до конца | |
// 3. В консоль браузера вставляем нежеследующий код и давим Enter | |
// 4. Подтверждаем удаление постов | |
(function() { | |
'use strict'; | |
if (!confirm('Удалить все записи со стены?')){ | |
return; | |
} | |
var deletePostLink = document.body.querySelectorAll('a.ui_actions_menu_item[onclick^="wall.deletePost"]'); |
This file contains 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/bash | |
ROOT_PASSWORD=$(zenity --password --title "Enter root password") | |
if [ "${ROOT_PASSWORD}" ]; then | |
echo $ROOT_PASSWORD | sudo -S echo "TEST" > ./test.txt | |
fi |
This file contains 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
https://developer.chrome.com/extensions/webRequest — документация по входящим/исходящим хедерам | |
Пример удаления csp: | |
chrome.webRequest.onHeadersReceived.addListener(function(details) { | |
for (var i = 0; i < details.responseHeaders.length; i++) { | |
if ('content-security-policy' === details.responseHeaders[i].name.toLowerCase()) { | |
details.responseHeaders[i].value = ''; | |
} | |
} | |
return { | |
responseHeaders: details.responseHeaders |
This file contains 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
https://habrahabr.ru/post/248189/ |