Skip to content

Instantly share code, notes, and snippets.

View jittdev's full-sized avatar

Subrosa Games LLC jittdev

View GitHub Profile
@jittdev
jittdev / RockyLinux-Wiki1.txt
Created March 14, 2023 13:56
ROCKY LINUX - Wiki :: #VS
https://wiki.rockylinux.org/links/
@jittdev
jittdev / SeleniumTesting1.txt
Created March 14, 2023 13:56
selenium testing :: #Python Advanced
seleniumeasy.com
https://demo.seleniumeasy.com/ #testing ground
https://selenium-python.readthedocs.io/
http://allselenium.info/python-selenium-commands-cheat-sheet-frequently-used/
@jittdev
jittdev / CapybaraCheatsheet1.rb
Created March 14, 2023 13:56
Capybara Cheatsheet :: #RSpec
#Navigating
visit articles_path
#Clicking links and buttons
click_on 'Link Text'
click_button
click_link
#Interacting with forms
attach_file 'Image', '/path/to/image.jpg'
@jittdev
jittdev / CreateNewApp(Mysql,NoTurbo-Links)1.sh
Created March 14, 2023 13:56
Create new app (MySQL, No turbo-links) :: #Ruby / Rails
@jittdev
jittdev / AosElementAnimation1.txt
Created March 14, 2023 13:56
AOS element animation
// from the Node library: aos
// syntax
<div
data-aos="fade-up"
data-aos-offset="200"
data-aos-delay="50"
data-aos-duration="1000"
data-aos-easing="ease-in-out"
data-aos-mirror="true"
data-aos-once="false"
@jittdev
jittdev / UitableviewSlideToMulti1.m
Created March 14, 2023 13:56
UITableView Slide to Multi :: #Objective-C
-(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *button = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath)
{
NSLog(@"Action to perform with Button 1");
}];
button.backgroundColor = [UIColor redColor]; //arbitrary color
UITableViewRowAction *button2 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Mark\nRead" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath)
{
NSLog(@"Action to perform with Button2!");
}];
@jittdev
jittdev / Week3Challenge1.cpp
Created March 14, 2023 13:55
Week3 Challenge :: #C++
/*A class called Pair has already been declared, but the constructors have not been implemented yet. Pair has two public member variables:
int *pa,*pb;
These two "pointers to int" are intended to point to heap memory locations that store integers. The remainder of the Pair class expects the following functionality.
A single constructor Pair(int a, int b): This should set up pa and pb to point to newly allocated memory locations on the heap. The integers at those memory locations should be assigned values according to the constructor's integer arguments a and b.
A copy constructor Pair(const Pair& other): This takes as its argument a read-only reference to another Pair. It should set up the newly constructed Pair as a "deep copy," that is, it should create a new Pair that is equivalent to the other Pair based on dereferenced values but does not reuse any of the same memory locations. In other words, the copy constructor should set up its own instance's member variables pa and pb to point to newly a
@jittdev
jittdev / DefiningConstantsWDefaultParams1.js
Created March 14, 2023 13:55
defining constants w/ default params :: #Javascript
const exponentiate = (base, power) => {
let exponentiatedValue = 1;
for (i = 1; i <= power; ++i) {
exponentiatedValue *= base;
}
return exponentiatedValue;
}
// can do the same thing with:
@jittdev
jittdev / Filter()1.py
Created March 14, 2023 13:55
filter() :: #Python Advanced
my_list = [1,2,3]
def only_odd(item):
return item % 2 != 0
print(list(filter(only_odd, my_list)))
#=> [1,3]
@jittdev
jittdev / User.FollowersUsingPassiveRelationships1.rb
Created March 14, 2023 13:55
user.followers using passive relationships :: #Ruby / Rails
#app/models/user.rb
class User < ApplicationRecord
has_many :microposts, dependent: :destroy
has_many :active_relationships, class_name: "Relationship",
foreign_key: "follower_id",
dependent: :destroy
has_many :passive_relationships, class_name: "Relationship",
foreign_key: "followed_id",
dependent: :destroy
has_many :following, through: :active_relationships, source: :followed