This file contains hidden or 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
| ### Keybase proof | |
| I hereby claim: | |
| * I am lokideos on github. | |
| * I am lokideos (https://keybase.io/lokideos) on keybase. | |
| * I have a public key ASCAdheIJr77ecTcMulXdHO7hs2ETKB6e8p2NZs0GSbC2Qo | |
| To claim this, I am signing this object: |
This file contains hidden or 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
| #include "json2.js" | |
| function log (input) { | |
| if(!debug) return; | |
| if(!JSON || !JSON.stringify) return; | |
| var now = new Date(); | |
| var output = JSON.stringify(input); | |
| $.writeln(now.toTimeString() + ": " + output); |
This file contains hidden or 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
| #include "json_log.js"; | |
| // Enable logging | |
| var debug = true; | |
| // Получаем путь к скрипту | |
| var scriptFile = new File($.fileName); | |
| var scriptFolderPath = scriptFile.parent; | |
| // Получаем список файлов в папке со скриптом | |
| var fileList = scriptFolderPath.getFiles(/\.(jpg|psd)$/i); |
This file contains hidden or 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
| # Running rake tasks from console | |
| require 'rake' | |
| Rails.application.load_tasks | |
| Rake::Task['my_task'].invoke | |
| # Running rake task with arguments | |
| Rake::Task['my_task'].invoke("arg1", "arg2") |
This file contains hidden or 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
| Add the following code to your `.zprofile` file. Now, if you type `github` from the root directory of your project, | |
| your browser will open a new tab with your repository opened on GitHub. | |
| ``` | |
| github() { | |
| if [ ! -d .git ] && ! git rev-parse --git-dir >/dev/null 2>&1; then | |
| echo "ERROR: This isnt a git directory" && return false | |
| fi | |
| git_url=$(git config --get remote.origin.url) | |
| if [[ $git_url == https://gitlab* ]]; then |
This file contains hidden or 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
| sudo lsof -i -P | grep LISTEN |
This file contains hidden or 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
| # Go to the end of the line and switch to insert mode | |
| Shift + A | |
| # Search and replace all occurencies | |
| :%s/(what to search)/(to what replace)/g |
This file contains hidden or 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
| # command to delete logs - although you will be force to restart containers | |
| sudo find /var/lib/docker/containers/ -type f -name "*.log" -delete |
This file contains hidden or 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
| # make backup file from pg db located on localhost. .dump extension is optional, but desirable | |
| PG_PASSWORD="<your db password>" pg_dump -h localhost -d <your database name> -U <your db user> > <backup file name>.dump | |
| # load backup file to your db to db in docker container | |
| cat <backup file name> | docker exec -i <container name> psql -U <db user> -d <your db name> |
This file contains hidden or 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
| # If you encounter any old ruby installation/old gem installation problems there is a good chance that it cannot find | |
| # universal-darwin19 file. For this purpose you should create symlink with needed name to currend universal-darwin file | |
| cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0 | |
| ln -sf universal-darwin20 universal-darwin19 | |
| # If you encounter any problems with rubygems during old ruby installation reinstall ruby with older rubygems version | |
| # Following command is example for reinstalling ruby 2.3.8 using rvm with older rubygems version (2.6.8) | |
| rvm reinstall 2.3.8 --rubygems 2.6.8 | |
| # In order to install gems you need openssl. |
NewerOlder