Skip to content

Instantly share code, notes, and snippets.

View mazsam's full-sized avatar
👋

Samsul Arifin mazsam

👋
View GitHub Profile
import { useEffect, useState } from 'react';

const useClientMediaQuery = () => {
  const [device, setDevice] = useState({
    mobile: false,
    tablet: false,
    desktop: false,
  });
# Notice the v1beta3 version
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
# some metadata about the template itself
metadata:
name: v1beta3-demo
title: Test Action template
description: scaffolder v1beta3 template demo
spec:
owner: backstage/techdocs-core

Create folder example on root project and create bellow files

index.html

<!doctype html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Example</title>
CREATE VIEW view_monthly_pricing AS
SELECT
COALESCE(asset_data.company_id, license_data.company_id) AS company_id,
COALESCE(asset_month, license_month) AS month,
COALESCE(total_asset_price, 0) AS total_asset_price,
COALESCE(total_license_price, 0) AS total_license_price,
COALESCE(total_asset_price, 0) + COALESCE(total_license_price, 0) AS total_price
FROM
(SELECT
company_id,
CREATE VIEW view_assignments AS
WITH
user_info AS (
SELECT
u.id as user_id,
u.name as user_name,
u.email as user_email,
lct.id as location_id,
lct.name as location_name
FROM
CREATE VIEW users_view AS
SELECT
u.*,
c.name as company_name,
d.name as department_name,
r.name as role_name,
l.name as location_name
from users u
LEFT JOIN
companies c ON u.company_id = c.id
CREATE VIEW view_licenses AS
SELECT
l.*,
s.name AS status_name,
c.name AS company_name,
pt.name AS payment_term_name,
COALESCE(li.total_license_items, 0) AS total_license_items,
COALESCE(li.ready_to_use_license_items, 0) AS ready_to_use_license_items
FROM
licenses l
percentage standarization_reporting_id
0 13
0 21
0 23
0 22
0 30
0 31
0 33
0 34
0 35
@mazsam
mazsam / gist:782c3ddd5722e3598e7b30202f53af54
Created February 2, 2024 03:19
Find and remove node_modules
find . -name "node_modules" -type d -prune | xargs du -chs
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
USE [MQ]
GO
/****** Object: Table [dbo].[Config] Script Date: 1/3/2024 6:45:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO