Skip to content

Instantly share code, notes, and snippets.

View Demieno's full-sized avatar

kamed Demieno

  • Odessa, Ukraine
View GitHub Profile
@Demieno
Demieno / Generating_password.js
Last active January 31, 2018 21:14
Generating a password of a given length
function generate(len)
{
var ints =[0,1,2,3,4,5,6,7,8,9];
var chars=['A','a','B','b','C','c','D','d','E','e','F','f','G','g','H','h','J','j','K','k','L','l','M','m','N','n','O','o','P','p','R','r','S','s','T','t','U','u','V','v','W','w','X','x','Y','y','Z','z'];
var out='';
for(var i=0;i<len;i++){
var ch=Math.random(1,2);
if(ch<0.5){
var ch2=Math.ceil(Math.random(1,ints.length-1)*10);
if(ints[ch2] !== undefined){
@Demieno
Demieno / clojure.md
Created March 22, 2018 19:38
Setting Up Clojure on OS X

Setting Up Clojure on OS X

I spent a lot of time trying to find a pretty optimal (for me) setup for Clojure… at the same time I was trying to dive in and learn it. This is never optimal; you shouldn't be fighting the environment while trying to learn something.

I feel like I went through a lot of pain searching Google, StackOverflow, blogs, and other sites for random tidbits of information and instructions.

This is a comprehensive "what I learned and what I ended up doing" that will hopefully be of use to others and act as a journal for myself if I ever have to do it again. I want to be very step-by-step and explain what's happening (and why) at each step.

I appreciate the effort you've put into documenting this, but there are a number of inaccuracies here that need to be addressed. We get

# добавить код в .bashrc или .zshrc in macOS
# удаляет все файлы .pyc и .pyo и каталоги __pycache__ - использовать команду в терминале в нужном проекте —> pyclean
pyclean () {
find . -type f -name "*.py[co]" -delete
find . -type d -name "__pycache__" -delete
}
@Demieno
Demieno / .gitconfig
Created March 25, 2018 11:30 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
# Количество строк одной таблицей за раз
SELECT count(*) FROM table_name;
# Второй подход отмечает, что сборщик статистики отслеживает примерно количество строк в
# реальном времени (не удаленных или устаревших позже) в любое время. Это значение может быть
# немного уменьшено при активности, но, как правило, хорошая оценка:
SELECT schemaname,relname,n_live_tup
@Demieno
Demieno / spacemacs-cheshe.md
Created May 17, 2018 17:53 — forked from robphoenix/spacemacs-cheshe.md
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers
Файл настройки: ~/.vimrc
Можно редактировать файлы через сеть, например
:e <scp|ftp|ftps>://user@host/path/to/the/file.txt
:Ex или :e ./ - файловый менеджер
== Основы ==
hjkl перемещение в разные стороны
i режим вставки
I добавление в начало строки
a режим добавления
\а звонок
\b возврат на одну позицию (backspace)
\f перевод страницы
\n перевод строки
\г возврат каретки
\t горизонтальная табуляция
\v вертикальная табуляция
\\ обратный слеш
\" двойная кавычка
\' одинарная кавычка
@Demieno
Demieno / pug.md
Created June 17, 2019 20:27 — forked from neretin-trike/pug.md
Туториал по HTML препроцессору Pug (Jade)
@Demieno
Demieno / 60-jetbrains.conf
Last active August 5, 2019 08:37 — forked from bittner/60-jetbrains.conf
Inotify configuration for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm). Create this file with e.g. `sudo vim /etc/sysctl.d/60-jetbrains.conf`
# Set inotify watch limit high enough for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm).
# Create this file as /etc/sysctl.d/60-jetbrains.conf (Debian, Ubuntu), and
# run `sudo service procps start` or reboot.
# Source: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
#
# решение вопроса https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
#
# More information resources:
# -$ man inotify # manpage
# -$ man sysctl.conf # manpage