Skip to content

Instantly share code, notes, and snippets.

View SchDen's full-sized avatar
🚀

Den SchDen

🚀
View GitHub Profile
@SchDen
SchDen / .zshrc
Created October 29, 2021 12:33
.zshrc
PROMPT='%(?.%F{green}√.%F{red}?%?)%f %B%F{240}%1~%f%b $ '
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
@SchDen
SchDen / item.json
Created October 29, 2021 12:32
MTMR preset
[
{
"type": "shellScriptTitledButton",
"width": 60,
"refreshInterval": 2,
"source": {
"inline": "/usr/local/bin/osx-cpu-temp"
},
"align": "left",
"bordered": false
@SchDen
SchDen / .bash_profile
Last active October 29, 2021 10:28
Default Ubuntu ENV
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 / index.js
Last active June 9, 2018 17:24
Move gettext (*.po) file to ms excel or google spreadsheet
// Insert a text from *.po file to `str` var,
// then copy result table (ctrl+a, ctrl+c) to ms excel/google spreadsheets (ctrl+v)
// You can use https://jsfiddle.net or https://codepen.io for quick use
// https://codepen.io/anon/pen/aKpwxL?editors=1010
const str = `
#For example:
msgid "My name"
msgstr "Mein Name"
`;
@SchDen
SchDen / doctrine.sh
Created September 16, 2016 20:26
Doctrine generate proxy
./vendor/bin/doctrine orm:generate-proxies
@SchDen
SchDen / keybindings.json
Last active September 12, 2016 12:18
Visual studio
[
// Exit from visual mode
{
"key": "ctrl+c",
"command": "extension.vim_escape"
},
// Go to prev pane
{
"key": "ctrl+shift+h",
@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/
@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\]'
{
  "currentStep": 3,
  "step1": {
    "content": {
      "title": "Поможем оформить интересную новость",
      "preview": "«МойДом» подготовил ряд советов и правил, \nпридерживаясь которых, Вам удастся сделать интересный \nи визуально приятный материал для прочтения",
      "original": "/st1/zgljamn4/1467984924577fac1c66483.jpg"
    }
  },
  "step2": {
@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.