This file contains 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
// File: package.json | |
"dependencies": { | |
"@web3modal/ethereum": "^2.0.0-rc.1", | |
"@web3modal/react": "^2.0.0-rc.1", | |
"axios": "^1.1.3", | |
"ethers": "^5.7.2", | |
"next": "12.1.5", | |
"react": "18.0.0", | |
"react-dom": "18.0.0", | |
"swr": "^1.3.0", |
This file contains 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
========== | |
.tmux.conf | |
========== | |
unbind C-b | |
set-option -g prefix C-a | |
bind-key C-a send-prefix | |
set-option -g history-limit 10000 | |
set-window-option -g xterm-keys | |
set-option -g mouse on |
This file contains 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
Skipping some of the very basic commands, to use this cheat sheet you need atleast some vim knowledge. | |
; # repeat last search done using f | |
, # undo last search done using f | |
u # undo last change | |
ctrl+r # redo last change | |
:%s/t/r/g # replace all 't' by 'r' | |
:%s/t/r/gc # replace all 't' by 'r' with confirmation | |
~ # change case | |
gu # to lower case |
This file contains 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/local/bin/ruby -swI . | |
# | |
# AUTOMATE UPDATING ALL PROJECTS | |
# | |
# Problem: going to each project and then pulling changes. | |
# Solution: Automate git pulling for all my projects | |
# | |
# 1. Create a pull_projects file and add the code from this gist | |
# 2. Move the file into a directory that is in your path, i.e. $PATH | |
# 3. Make the file executable, eg. chmod +x /usr/local/bin/pull_projects |
This file contains 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
Binary | |
====== | |
* Import database | |
mongorestore -h host:port -d experimental2 -u <user> -p <password> <input db directory> | |
* Export database | |
mongodump -h host:port -d experimental2 -u <user> -p <password> -o <output directory> | |
* Import collection | |
mongorestore -h host:port -d experimental2 -u <user> -p <password> <input .bson file> | |
* Export collection | |
mongodump -h host:port -d experimental2 -c <collection> -u <user> -p <password> -q <query else will export full collection> -o <output directory> |
This file contains 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 ruby | |
# Usage: gitio URL [CODE] | |
# | |
# Turns a github.com URL | |
# into a git.io URL | |
# | |
# Copies the git.io URL to your clipboard. | |
url = ARGV[0] | |
code = ARGV[1] |
This file contains 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
bundle 1.2.3 not compatible with ruby 2.0.0.preview2, do | |
gem install bundler --pre | |
to install bundler 1.3.0.pre.4 | |
For any ssl issues | |
openssl needs to be >= 1.0.1 | |
brew install openssl | |
brew link openssl |
This file contains 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/local/bin/ruby | |
grep = `git grep -n #{ARGV[0]} #{ARGV[1]}` | |
puts "\n-----------------------------------------------------------" | |
puts "GREP RESULT" | |
puts '-----------------------------------------------------------' | |
puts grep | |
files = grep.scan /.*\:\d+/ |
This file contains 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/ruby | |
directory = "app/models" | |
all_files = Dir.glob(File.join('app/models', '**', '*.rb')) | |
puts "Potentially modifying #{all_files.size}. Do you want to continue? [y/n]" | |
reply = gets | |
exit unless %w(y yes).include? reply.chomp.downcase | |
all_files.each do |filename| |
This file contains 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
# Convert any YouTube video into an audio file you can listen to on the go, using: | |
# http://rg3.github.com/youtube-dl/ | |
{ ~ } > brew install ffmpeg | |
{ ~ } > brew install ffprobe | |
{ ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl | |
{ ~ } > chmod u+x youtube-dl | |
# Pick which video format you want to download.. (use any YT video link) |
NewerOlder