Skip to content

Instantly share code, notes, and snippets.

💎
Searching for Ruby gems

Beyar Beyarz

💎
Searching for Ruby gems
Block or report user

Report or block Beyarz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Beyarz
Beyarz / log.md
Created Feb 11, 2020
See hidden files macOS
View log.md

You can see hidden files by opening terminal and copy-pasting:

defaults write com.apple.finder AppleShowAllFiles YES

@Beyarz
Beyarz / nvm.md
Last active Feb 12, 2020
nvm is not compatible with the npm config “prefix” option..
View nvm.md

Delete and Reset the prefix

npm config delete prefix

Change the version number with the one indicated in the error message.

npm config set prefix $NVM_DIR/versions/node/v12.8.0

@Beyarz
Beyarz / npm.md
Created Feb 5, 2020
npm global package
View npm.md

Remove package globally

Let's say you install a package globally npm install -g jshint

and then you are unable to fully remove it globally. And you have tried npm uninstall -g jshint Then try this then: npm rm -g jshint

View Group every second element.md
John
30
Mike
0.0786268
Tyson
0.114889
Gabriel
0.176072
Fiona
@Beyarz
Beyarz / git.log
Last active Jan 21, 2020
Go back to wanted version
View git.log
git revert commit_hash
git switch -c wanted_version
git merge --strategy=ours master
git checkout master
git merge wanted_version
View git remote.md
View rb.rb
# Insert a character after every N step in a string
require "securerandom"
SecureRandom.hex(4).scan(/.{4}/).join("-")
# Shorthands
'123'.chars === '123'.split('')
["1", "2", "3"] === %w[1 2 3]
%w[a b c].map { |x| x.join } === %w[a b c].map(&:join)
@Beyarz
Beyarz / brew cu
Last active Jan 16, 2020
brew cu
View brew cu
# Update brew apps
date >> /Users/USER/nohup.out
nohup sh -c 'brew cu --yes && brew upgrade && brew cleanup' >> /Users/USER/nohup.out &
@Beyarz
Beyarz / vi.md
Last active Jan 14, 2020
vi notes
View vi.md

Shortcuts

i - write
o - write newline
D - remove end of line
dd - remove current line
/ - find next string
? - find previous string
yy - copy (yank)
p - paste

@Beyarz
Beyarz / sed.sh
Created Jan 12, 2020
sed search and replace
View sed.sh
sed -i '' -e 's/index.rb/hello.rb/g' now.json
You can’t perform that action at this time.