Skip to content

Instantly share code, notes, and snippets.

View jittdev's full-sized avatar

Subrosa Games LLC jittdev

View GitHub Profile
@jittdev
jittdev / ModuleTemplateConfigIfRunIntoModuleNameerro(UninitializedConstantController::Module)1.rb
Created March 14, 2023 13:56
Module Template config if run into module NameErro (uninitialized constant Controller::Module) :: #Ruby / Rails
### error throws when "require modulename" is added to controller
### added by me to config/environments/development.rb. (or production.rb)
config.autoload_paths << Rails.root.join('lib')
### in between the Rails.application.configure do right before the end tag
### (modules should go in app/modules/modulename.rb)
@jittdev
jittdev / _PartialExample1.html
Created March 14, 2023 13:56
_partial example :: #Angular
<div class="results-block">
<!-- Placeholder for messages -->
</div>
<div id="stock-lookup-results" class="well results-block">
<strong>Symbol:</strong> {‌{stock.symbol}}
<strong>Name:</strong> {‌{stock.name}}
<strong>Price:</strong> {‌{stock.last_price}}
<a href="#" class="btn btn-xs btn-success">Add To My Stocks</a>
<span class="label label-defuault"></span>
</div>
@jittdev
jittdev / Regex1.py
Created March 14, 2023 13:56
regex :: #Python Advanced
# https://www.w3schools.com/python/python_regex.asp
# regex101.com or regexone.com
import re
string = 'search inside of this text please!'
a = re.search('this', string)
print(a.span())
print(a.start())
@jittdev
jittdev / PathOnServer1.txt
Created March 14, 2023 13:56
path on server :: #SSL
# put pem file here:
/etc/pki/tls/certs/
# put .key file into
/etc/pki/tls/private/
SSLCertificateKeyFile /etc/pki/tls/private/subrosagames_com_key.key
SSLCertificateFile /etc/pki/tls/certs/subrosagames_com.pem
SSLCACertificateFile /etc/pki/tls/certs/ca_bundle.crt
@jittdev
jittdev / PaperclipAddValidationToModel1.rb
Created March 14, 2023 13:56
paperclip add validation to model :: #Ruby / Rails
has_attached_file :image, styles: { thumbnail: "50x50#", profile: "210x210#" }
validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/
@jittdev
jittdev / MachineLearningTools1.txt
Last active March 14, 2023 13:56
Machine Learning Tools :: #DataScience/ML
using python:
NumPy
SkiKit
Matplotlib
Kaggle
and install Anaconda so we can get Jupyter notebook free
@jittdev
jittdev / CloningFromGit1.txt
Created March 14, 2023 13:56
Cloning from GIT :: #React-Native
git clone git@github.com:DEVGW/react-native-appStarter.git
// or whatever the link is
// then go into the directory and type
npm i
// this should install everything the app needs to run
// if project used yarn then:
yarn install
@jittdev
jittdev / InitialServerSetup-RockyLinux1.txt
Created March 14, 2023 13:56
Initial Server Setup - ROCKY LINUX :: #VS
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-rocky-linux-8
@jittdev
jittdev / ArraysIii:Spreading1.js
Created March 14, 2023 13:56
Arrays III : Spreading :: #Javascript
// Takes a formatted multidimensional array and outputs sentences using constants:
function zooInventory(aZoo) {
let animalFacts = [];
for (let i=0; i < aZoo.length; i++) {
const currentAnimal = aZoo[i];
const animalName = currentAnimal[0];
const animalType = currentAnimal[1][0];
const animalAge = currentAnimal[1][1];
@jittdev
jittdev / TypeCasting1.md
Created March 14, 2023 13:56
type casting :: #C++

// This is the phenomenon where a value is automatically converted to a different type in order to allow an operation to continue. For example, if you try to add together a floating point double value and an integer int value, the int will be converted to double first, and then the result of the addition will have type double as well. But if you save a double value to an int variable, the floating point value will be truncated to an integer! For example:

#include int main() { int x = 2; double y = 3.5; std::cout << "This result will be a double with value 5.5: " << (x+y) << std::endl;

int z = x+y; // This expression is calculated as a double, but then it's cast back to int! std::cout << "This result will be an int with value 5: " << z << std::endl;