Skip to content

Instantly share code, notes, and snippets.

View jittdev's full-sized avatar

Subrosa Games LLC jittdev

View GitHub Profile
@jittdev
jittdev / Authorized_KeysFile1.txt
Created March 14, 2023 13:47
authorized_keys file :: #VS
yum install nano
cd .ssh
nano authorized_keys
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA0ifkuYryrhv3n28OtfLVb6ctiJPhGw2q9FH8R7Rn/F jason@cryptechstudios.com
ssh-rsa key
CTRL-X. y
@jittdev
jittdev / UpdateQuery1.sql
Created March 14, 2023 13:47
update query :: #PostgreSQL
update sharks set facts='Hammerheads are more violent than great whites if you piss them off' where name='Hammerhead';
-- single quotes!!!
@jittdev
jittdev / InstallingHomebrew:Ruby:RailsFromScratch1.rb
Created March 14, 2023 13:47
Installing Homebrew:Ruby:Rails from Scratch :: #Ruby / Rails
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# then follow this link: https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-macos commands from this link are below:
brew install rbenv
nano .bash_profile
# etc.: keep following the instructions on that link.
@jittdev
jittdev / SshToAllClientServers1.txt
Created March 14, 2023 13:47
SSH to all client servers :: #VS
ssh in, pw Bl4hCr4p!@
and then add:
Host *github.com
  AddKeysToAgent yes
  IdentityFile ~/.ssh/id_ed25519
  
  
@jittdev
jittdev / InputExamples1.py
Created March 14, 2023 13:47
Input Examples :: #Python Basics
username = input('What is your username?')
password = input('What is your password?')
password_length = (len(password))
hidden_password = '*' * password_length
print(f'{username}, your password, {hidden_password}, is {str(password_length)} letters long')
# What is your username?blah
# What is your password?crapper
@jittdev
jittdev / RelineDatabase-TerminfoBullshit1.txt
Created March 14, 2023 13:47
reline Database - TERMINFO BULLSHIT :: #shell
# edit ~/.tmux.conf to make sure 256color said screen:
set -g default-terminal screen-256color
# then
tmux source-file ~/.tmux.conf
@jittdev
jittdev / BetterErrorsGem1.ini
Created March 14, 2023 13:47
Better Errors Gem :: #error_reporting gem
https://github.com/BetterErrors/better_errors
#this also needs the binding_of_caller gem / both are added to Gemfile under the Development section
# add these lines to development.rb:
### added for better errors gem
config.consider_all_requests_local = true
# BetterErrors::Middleware.allow_ip! 'xxx.xxx.x.x'
@jittdev
jittdev / %WStringArrays1.rb
Created March 14, 2023 13:47
%w String Arrays :: #Ruby / Rails
# %w makes string arrays out of arrays
%w[A B C].map { |char| char.downcase }
#=> ["a", "b", "c"]
@jittdev
jittdev / DunderMethods1.py
Created March 14, 2023 13:47
dunder methods :: #Python Basics
# dunder methods are special or magic methods
class Toy():
def __init__(self, color, age):
self.color = color
self.age = age
action_figure = Toy('red', 0)
print(action_figure.__str__()) #this is the same as:
print(str(action_figure)) #this
@jittdev
jittdev / ObjectSpreadsRefactoring1.js
Created March 14, 2023 13:47
Object Spreads refactoring :: #Javascript
// create clone of an object
function cloneMachine(parent) {
let clonedName = `${parent.name}Clone`
let clone = {
name: `${parent.name}Clone`,
species: parent.species,
offspring: []
};
parent.offspring.push(clonedName);
return clone;