Skip to content

Instantly share code, notes, and snippets.

View SchDen's full-sized avatar
🚀

Den SchDen

🚀
View GitHub Profile
alias vrc="vim ~/.vimrc"
alias pvrc="vim .vimrc"
#-- GIT
alias gs='git status'
alias gadd="git add -A .;clear;git status"
alias pushorigin="git push origin"
alias pullmaster="git pull origin master"
alias pullcurrent="git pull origin $(git rev-parse --abbrev-ref HEAD)"
# Ctr to Alt
#set -g prefix m-'\'
# Update default key
unbind C-b
set -g prefix C-t
bind C-t send-prefix
# For copy on Esc key
unbind [
bind Escape copy-mode
@SchDen
SchDen / .bash_aliases
Created October 12, 2015 08:14
Git - pull & push current branch
# Push current branch
# Note: befoe - type in console "git config --global push.default=current"
alias pushcurrent="git push origin"
# Pull current branch
function pullcurrent {
git pull origin $(git rev-parse --abbrev-ref HEAD)
}
alias gs='git status'
alias gadd="git add -A .;clear;git status"
# Push current branch
# Note: befoe - type in console "git config --global push.default=current"
alias pushcurrent="git push origin"
# Pull current branch
function pullcurrent {
git pull origin "$(git rev-parse --abbrev-ref HEAD)"
@SchDen
SchDen / gist:924ff85a33bed53ccce0
Created January 13, 2016 14:22
Check merged branches
git branch --merged test | grep '^ 160'
/**
* Класс для отправки запросов на сервер
* @param {string} url
* @param {object} options колбэки для обраотки запроса, данные для отпраки
* @return {object} возвращает экземпляр xhr запроса
*/
function Reqeust(url, options) {
// Тип запроса
var requestType = options.requestType || 'POST';
@SchDen
SchDen / getSelectedText.js
Last active April 1, 2016 13:01
Draft.js - getSelectedText
/**
* Returns normalized selection values so you can be sure that `anchorKey` is the
* first and `focusKey` the last block in your selection.
*
* @see https://gist.github.com/johanneslumpe/5865625e2992d0718cfb45d8a4c47879
*
* @param {object} selection A draft.js `SelectionState` instance
*
* @return {object} An object containing normalized `anchorKey`, `anchorOffset`,
* `focusKey` and `focusOffset` values.
{
  "currentStep": 3,
  "step1": {
    "content": {
      "title": "Поможем оформить интересную новость",
      "preview": "«МойДом» подготовил ряд советов и правил, \nпридерживаясь которых, Вам удастся сделать интересный \nи визуально приятный материал для прочтения",
      "original": "/st1/zgljamn4/1467984924577fac1c66483.jpg"
    }
  },
  "step2": {
@SchDen
SchDen / format.sh
Last active June 27, 2019 06:47
Bash string format
# tony777@Tony777s-iMac | ~/projects $
export PS1='\[\e[0;32m\]\u\[\e[m\]\[\e[0;32m\]@\[\e[m\]\[\e[0;32m\]\h\[\e[m\] | \[\e[1;33m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] \[\e[1;37m\]'
@SchDen
SchDen / mac-chrome-without-security.sh
Last active October 3, 2018 09:07
Mac OSX launch chrome without security
open /Applications/Google\ Chrome.app --args --disable-web-security --user-data-dir=~/ChromeUserData/