Skip to content

Instantly share code, notes, and snippets.

View jittdev's full-sized avatar

Subrosa Games LLC jittdev

View GitHub Profile
@jittdev
jittdev / CopyConstructor1.cpp
Created March 14, 2023 13:46
Copy Constructor :: #C++
// Automatic Copy Constructor provides an automatic copy constructor for our class if we do not provide a custom one.
// The automatic copy constructor will copy the contents of all member variables.
/* Custom Copy Constructor must:
- be a Class constructor
- have exactly one argument which must be a const reference of the same type as the class
eg: Cube::Cube(const Cube & obj) the '&' means passed by reference */
/* Copy constructors are often invoked automatically:
@jittdev
jittdev / OverrideBootstrapCss1.txt
Created March 14, 2023 13:46
Override Bootstrap CSS :: #Bootstrap5 Rails 7
1. in manifest.js: //= link mycustom.css
2. uncomment gem "sassc-rails" in Gemfile
3. application.html.erb: <%= stylesheet_link_tag "mycustom", "data-turbo-track": "reload" %>
4. mycustom.css write your own styles
5. rails assets:clobber
6. rails assets:precompile
@jittdev
jittdev / Super()1.py
Created March 14, 2023 13:47
super() :: #Python Basics
#With this, Wizard has no attribute 'email' because we already have a constructor in Wizard. Constructor of parent class (super) is not getting inherited:
class User(object):
def __init__(self, email):
self.email = email
def sign_in(self):
print('logged_in')
class Wizard(User):
@jittdev
jittdev / InstallMysqlGem1.txt
Created March 14, 2023 13:47
Install mysql gem
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
@jittdev
jittdev / ObjectMethods1.js
Created March 14, 2023 13:47
Object Methods :: #Javascript
// define a method by putting the function after a property in an object:
let me = {
'name' : '',
getGreeting: function() {
return `Hi, my name is ${this.name}.`
}
}
me.name = 'Mary'
console.log(me.getGreeting());
>Hi, my name is Mary.
@jittdev
jittdev / InstallingWithoutDocumentation1.rb
Created March 14, 2023 13:47
INSTALLING WITHOUT DOCUMENTATION :: #Ruby / Rails
# >> is the append operator. if no file exists it will create one; thic configures the .gemrc file to skip the installation of Ruby documentation
echo "gem: --no-document" >> ~/.gemrc
# to ensure it is created:
cat ~/.gemrc
# install rails
gem install rails -v 6.x.x
# install Bundler with a specific version number
@jittdev
jittdev / DeviseRoutes.Rb1.rb
Created March 14, 2023 13:47
devise routes.rb :: #Ruby / Rails
#devise_for :users
devise_for :users, :controllers => {registrations: 'users/registrations', :confirmations => "users/confirmations", sessions: 'users/sessions', :omniauth_callbacks => "users/omniauth_callbacks"}
@jittdev
jittdev / Wings1.ini
Created March 14, 2023 13:47
Wings :: #XXXNoWork
Perfect Crispy Keto Wings
• 4# wing sections
• 2 Tbsp Baking Powder
• 1/4 Tbsp Salt
• 1.5 Tbsp Onion Powder
• 1.5 Tbsp Garlic Powder
• 3/4 Tbsp Paprika
• 1/4 Tbsp Cayenne
Rack and sprinkle both side generously then refrigerate at least 4 hours to pull any moisture out, longer the better.
Bake 275° for 30 minutes (You can freeze extra wings for another day at this point if needed)
@jittdev
jittdev / UserfulPythonLinks1.txt
Created March 14, 2023 13:47
Userful Python links :: #Python Basics
# Math
https://www.programiz.com./python-programming/modules/math
@jittdev
jittdev / Echo1.sh
Created March 14, 2023 13:47
echo :: #shell
echo
echo
echo
echo 'done yet?'
echo 'nope'
echo
echo
echo