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
// 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 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
# 1) Create your private key (any password will do, we remove it below) | |
$ cd ~/.ssh | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
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
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 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
========== | |
.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 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 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 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
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 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
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 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/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 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
# 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) |
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/ruby | |
raise "Provide the dir path" unless ARGV[0] =~ /[a-z]*/ | |
to_dir = ARGV[0].strip | |
raise "Provide the dir path" if to_dir.nil? | |
site = 'http://url' | |
print "Processing home page ... " |
NewerOlder