Skip to content

Instantly share code, notes, and snippets.

View cre-o's full-sized avatar
🏡
Working from home

Sergey Shukhta cre-o

🏡
Working from home
View GitHub Profile
@cre-o
cre-o / chess_board.html
Last active April 2, 2020 22:38
Friend asked me for help (creative way to render chess board)
<!DOCTYPE html>
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><title>*** unnamed text ***</title></head><body>
<style>
:root {
--green: rgb(146, 159, 99);
}
table.CHESS
@cre-o
cre-o / production.rb
Created March 12, 2019 09:56
For using paperclip with sidekiq on production (Ubuntu)
Rails.application.configure do
Paperclip.options[:command_path] = 'usr/local/bin'
end
@cre-o
cre-o / instructions.md
Last active February 23, 2019 19:00
Data sync between jQuery and Angular 1

Html file

<div class="js-synced-tabs" ng-click="syncWithjQuery()" data-tab-id="1" style="width: 0; height: 0;"></div>
<div class="container" id="draggable-status-list">
<!-- appends from jQuery -->
</div>

jQuery file

@cre-o
cre-o / Keybindings
Created February 19, 2019 09:09
Iterm2 default keybindings
To jump between words and start/end of lines in iTerm2 follow these steps:
iTerm2 -> Preferences (⌘ + ,)
Open the “Keys” tab
Add the following Global Shortcut Keys
Move cursor one word left
Keyboard Combination: ⌥ + ←
Action: Send Hex Code
Code: 0x1b 0x62
@cre-o
cre-o / Preferences.sublime-settings
Last active October 28, 2018 20:34
Sublime text 3 universal user settings
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"caret_style": "phase",
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"indent_guide_options":
[
"draw_normal",
"draw_active"
@cre-o
cre-o / rails-webpacker-foundaiton.txt
Last active September 9, 2017 12:09
Integration for foundation 6.4, webpacker and rails 5
You can read here:
https://github.com/cre-o/rails-webpacker-foundation
@cre-o
cre-o / instructions.txt
Last active June 22, 2017 18:12
WordPress css auto reload
// Use the following magic: https://www.browsersync.io/
npm install -g browser-sync
// Run your backend webserver such as apache or nginx
// Let say it runs on port 8080
// Now we can connect on in it with proxy option
browser-sync start --proxy "localhost:3000" --files "wp-content/themes/**/*.css"
@cre-o
cre-o / sites
Created January 24, 2017 07:47
JavaScript best practices
http://callbackhell.com/
@cre-o
cre-o / for-ubuntu.txt
Last active October 31, 2016 17:00
Почтовый сервер postifx + dovecot + saslauthd + mysql + roundcube + DKIM
Ресурсы по дайнной теме:
—Было взято за основу—
http://www.volmed.org.ru/wiki/index.php/%D0%9F%D0%BE%D1%87%D1%82%D0%BE%D0%B2%D1%8B%D0%B9_%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80_%D0%BD%D0%B0_%D0%B1%D0%B0%D0%B7%D0%B5_Postfix,_Dovecot_%D0%B8_Ubuntu_14.04_LTS
https://help.ubuntu.com/community/PostfixDovecotSASL
http://www.tutorialspoint.com/unix_commands/saslauthd.htm (saslauthd)
http://www.postfix.org/SASL_README.html (postfix sasl)
https://habrahabr.ru/post/151904/ (DKIM)
http://shurshun.ru/pochtovyie-rassyilki-opendkim-postfix/ (OpenDKIM)
@cre-o
cre-o / text
Created June 30, 2016 16:56
mysql reset root password ubuntu
B.5.3.2.2 Resetting the Root Password: Unix and Unix-Like Systems
On Unix, use the following procedure to reset the password for the MySQL 'root'@'localhost' account. To change the password for a root account with a different host name part, modify the instructions to use that host name.
The instructions assume that you will start the MySQL server from the Unix login account that you normally use for running it. For example, if you run the server using the mysql login account, you should log in as mysql before using the instructions. Alternatively, you can log in as root, but in this case you must start mysqld with the --user=mysql option. If you start the server as root without using --user=mysql, the server may create root-owned files in the data directory, such as log files, and these may cause permission-related problems for future server startups. If that happens, you will need to either change the ownership of the files to mysql or remove them.
Log on to your system as the Unix user that the MySQL se