Skip to content

Instantly share code, notes, and snippets.

View victorbruce's full-sized avatar
👨‍💻
focused

Victor Bruce victorbruce

👨‍💻
focused
View GitHub Profile
tag-version-release:
needs: build-production
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@master
- name: Install Dependencies
run: |
# --------- Bump Android Version ---------------
desc "Android: Increase versionCode"
package = load_json(json_path: "./package.json")
private_lane :increase_android_version do
increment_version_code(gradle_file_path: './android/app/build.gradle')
increment_version_name(gradle_file_path: './android/app/build.gradle', version_name: package['version'])
end
# --------- Bump iOS Version ---------------
desc "iOS: Increment versionCode and set versionName to package.json version"

What is Nodejs

NodeJs is an open source runtime environment. Runtime simply means something that is executable in it's own environment. Nodejs was built on google's chrome v8 javascript engine.

Node is not a convention based platform where everything is thought through such as the database, sessions, authentication, etc. For example PHP, Ruby on Rails etc. NodeJs has no idea or does not know which database you are going to hook on to.

Node is not recommmended for high CPU intensive operations like reading the file system asynchronously, or machine learning or large arithemetic. Node is good when it comes to concurrency.

/* Animate Smooth Scroll Snippet */
$('#view-work').on('click', function() {
const images = $('#images').position().top;
$('html, body').animate(
{
scrollTop: images
},
900
// this is just the happy paths
/* PRODUCT COMPONENT */
class Product extends Component {
state = {
products: PRODUCTS,
editProduct: {} // I added a property to the component state
}
// this method gets called when edit button is clicked
@victorbruce
victorbruce / pagination.md
Last active January 3, 2022 03:22
Paginating, Filtering, and Sorting in React

Pagination

To paginate a page, a general algorithm needs to be followed. Also, you should have the following variables in place:

  • Total items availabe or Items count (It can be a list of patients, books, etc coming from the database)
  • Number of items to display per page or Page size
  • Page count or number of pagination buttons to be rendered (**NB:**This needs to be calculated)

Calculation:

@victorbruce
victorbruce / Firebase.md
Last active January 12, 2025 18:31
My journey with Firebase so far. Cheatsheet to serve as a quick reference when developing firebase applications

Firebase

Set up firebase and Deploy

  • Head over to firebase. Sign in and create a project.

  • Copy your project settings under Firebase SDK snippet into your local project (ie your project's api key, auth domain, databaseURL, etc)

  • Create a file (firebase.js or config.js Any name that suits you is fine)

Deploying React App to App Engine

  • Run the command gcloud init
  • Reinitialize settings by choosing an account, a project, and a location
  • Create an app.yaml file
  • gcloud app deploy