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
| class MigrateHstoreToJson < ActiveRecord::Migration | |
| def up | |
| rename_column :posts, :data, :data_hstore | |
| add_column :posts, :data, :jsonb, default: {}, null: false, index: { using: 'gin' } | |
| execute 'UPDATE "posts" SET "data" = jsonb_object(hstore_to_matrix("data_hstore"))' | |
| remove_column :posts, :data_hstore | |
| end | |
| def down | |
| rename_column :posts, :data, :data_jsonb |
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
| #/usr/bin/env bash | |
| # "jump" command. | |
| # Written by IzikAJ <izikaj@gmail.com>. | |
| JUMP_PROJECTS_ROOT=~/www/ | |
| JUMP_PROJECTS_CONFIG_PATH=$JUMP_PROJECTS_ROOT/.config | |
| __find_and_cache_projects() | |
| { | |
| local f_bold f_dim f_normal c_yellow c_green |
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
| TODO: put short useful notes/commands/hacks/etc. |
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 my terminal color | |
| function parse_git_commit_prefix { | |
| git show -q HEAD~0 2> /dev/null | grep commit | sed -Ee 's/commit\ ([a-zA-Z0-9]{7}).*/\1/' | |
| } | |
| function parse_git_status { | |
| git status --porcelain 2> /dev/null | sed -Ene "s/\s*([A-Z\?]+).*/\1/p" | awk '!x[$0]++' | tr '\n' ' ' | sed -e '$s/ $//' | sed -Ee 's/\?\?/U/g' | sed -Ee 's/^[\ \t\s]+//' | sed -Ee 's/[\ \t\s]+/\ /g' | sed -Ee 's/\ /,/g' | sed -Ee 's/(.*)/\(\1\)/g' | |
| } | |
| function parse_git_branch { |
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
| Copy from here: http://stackoverflow.com/questions/33343159/gem-install-therubyracer-v-0-11-4#answer-36769517 | |
| I had the sam problem in OSX El Capitan. The steps I used to get over this were | |
| First check if V8 is installed or not. I used brew to install it. | |
| brew install homebrew/versions/v8-315 | |
| Try uninstalling libv8, therubyracer gems if some instance exists. | |
| gem uninstall -a libv8 |
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
| sed -i "" 's/\.\.\/images\//\/assets\//' $(find ~/www/.../app/assets/stylesheets/ -type f -name '*.scss') | |
| sed -i "" 's/\/scss\/base\/fonts\//\/assets\//' $(find ~/www/.../app/assets/stylesheets/ -type f -name '*.scss') | |
| sed -i "" 's/\/css\/base\/fonts\//\/assets\//' $(find ~/www/.../app/assets/stylesheets/ -type f -name '*.scss') | |
| sed -i "" "/\/\/ Cabinet/,/@import \"\.\.\/\.\.\/\.\.\/shared\/scss\/base\"\;/ d" ~/www/.../app/assets/stylesheets/theme/application.scss |
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
| Old variants: | |
| /Library/PostgreSQL/9.3/data/postmaster.pid | |
| ~/Library/Application Support/Postgres/var-9.4/postmaster.pid | |
| UPD 2022.09.28: | |
| From @luckyycode: | |
| for brew installed PostgreSQL, its located in /usr/local/var/postgres | |
| From me: | |
| /usr/local/var/postgres@[YourPGversion]/postmaster.pid |