Skip to content

Instantly share code, notes, and snippets.

View petehouston's full-sized avatar
in steroid mode at the moment ~

Pete Houston petehouston

in steroid mode at the moment ~
View GitHub Profile
@petehouston
petehouston / m2_get_products_data.sql
Created November 9, 2022 21:52 — forked from antoinekociuba/m2_get_products_data.sql
Magento 2 - Retrieve some products data (name, price, stock qty, images, categories...) from SQL query. On Magento Commerce versions, you will have to replace `entity_id` by `row_id`.
SELECT e.entity_id AS 'id',
v1.value AS 'name',
e.sku,
d1.value AS 'price',
si.qty AS 'qty',
t1.value AS 'short_description',
t2.value AS 'description',
v2.value AS 'image',
v3.value AS 'thumbnail',
mg.value AS 'media_gallery',
@petehouston
petehouston / README.md
Created May 28, 2022 02:01
homebrew mariadb reset root password

Quick guide to reset MariaDB root password on MacOS.

This tip can be used if you forget or want to change MariaDB root password.

Make sure to install MariaDB using Homebrew.

This tip is from Update root password in MariaDB 10.4 on MacOS

For MariaDB prior to v10.4

@petehouston
petehouston / Calculator.java
Created October 3, 2020 05:19
Calculator Servlet
package com.java;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@petehouston
petehouston / README.md
Last active April 10, 2020 04:57
[Persist project data between CircleCI jobs] A tip to persist project data between CircleCI jobs #circleci #devops
@petehouston
petehouston / rentCalculator.js
Created March 18, 2020 15:53
Calculator Strategy
class RentCalculator {
constructor() {
this.calculator = {
'Base_Flat': this._calcBaseFlat,
'Base_Percentage': this._calcBasePercentage,
'Base_Amount': this._calcBaseAmount,
'Gross_Flat': this._calcGrossFlat,
'Gross_Percentage': this._calcGrossPercentage,
'Gross_Amount': this._calcGrossAmount,
}
@petehouston
petehouston / index.js
Created March 18, 2020 15:00
Calculate
function calculateAverageBaseRate(
leaseTerm,
baseRate,
escalationValue,
escalationType,
freeRentType,
opex,
sizeSf,
numOfFreeMonths,
) {
@petehouston
petehouston / README.md
Created March 13, 2020 17:28
Generate signed JWT token string in Golang

Import the JWT package

import "github.com/dgrijalva/jwt-go"

Then generate with NewWithClaims.

Finally, get the signed JWT token string by calling SignedString().

@petehouston
petehouston / readme.md
Created January 7, 2020 13:51
Resolve Issue: dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

NOTE: This issue only happens on MacOS with Homebreww is the package manager.

ISSUE:

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

PROBLEM:

((12, 18), 1/3)
((12, 19), 1/3)
((12, 80), 1/3)
((15, 12), 1/18)
((15, 18), 8/18)
((15, 19), 3/18)
((15, 80), 4/18)
((15, 88), 1/18)
((15, 91), 1/18)