Skip to content

Instantly share code, notes, and snippets.

View ozkary's full-sized avatar
🎯
Focusing on the next reality to come

Oscar D. Garcia ozkary

🎯
Focusing on the next reality to come
View GitHub Profile
@ozkary
ozkary / restore-vscode.bat
Created June 4, 2025 14:00
Restores VSCode files after a windows update has isolated the files into a different folder
@echo off
setlocal
:: ==============================================================
:: Fix VS Code Folder Issue after Windows Update
:: ==============================================================
:: Some Windows updates seem to be isolating VS Code files under a "_"
:: subfolder inside the main installation directory. This script checks
:: if such a folder exists and prompts the user before moving its
:: contents back to the correct location.
@ozkary
ozkary / Data-Engineering-Process-Fundamentals-MTA-Discovery.html
Created October 31, 2024 19:40
Data Engineering Discovery Scripts
<!DOCTYPE html>
<html>
<head><meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Data Engineering Process Fundamentals Discovery Notebook</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<style type="text/css">
pre { line-height: 125%; }
@ozkary
ozkary / App-Declarative-Routes.tsx
Last active March 17, 2023 15:21
React Routing with Suspense approach to avoid re-rendering of child components. - See https://www.ozkary.com/2023/02/react-suspense-fallback-keeps-rendering.html
/*
Lazy loading component with Suspense support
*/
import React, { Suspense } from 'react';
import Loading from './Loading';
const App = (): JSX.Element => {
// lazy load the containers. This should create different chunk file
@ozkary
ozkary / helloworld.cpp
Last active May 1, 2022 19:19
A simple hello world application using standard output.
/*
* Copyright 2022 ozkary.com
* http://ozkary.com/ by Oscar Garcia
* Licensed under the MIT license. Please see LICENSE for more information.
*
* helloworld.cpp
* Simple Console standard output and input string
* ver. 1.0.0
*
* Created By oscar garcia - ozkary
@ozkary
ozkary / fluid-for-loop.xml
Last active March 22, 2022 20:08
APIM Fluid Scripts . These are policy transformation scripts. Use them to transform XML, JSON documents into JSON documents to match your platform requirements,
/*
@file fluid-for-loop.xml
@description Use this script to convert an input array into json properties. Notice how a command is not added to the last item.
Use hyphen to strip extra blank chrs.
@author ogarcia (ozkary)
@ref https://shopify.dev/api/liquid/objects/for-loops
Input JSON request:
{
"names": [
@ozkary
ozkary / staticwepapps.config.json
Created February 26, 2022 01:14
Static Web Apps configuration to handle HTTP 404 errors with a fallback policy
{
"routes": [
{
"route": "/",
"allowedRoles": ["anonymous"]
},
{
"route": "/about",
"allowedRoles": ["anonymous"]
},
@ozkary
ozkary / brand-a.yml
Last active March 22, 2022 14:45
Branding Apps with GitHub Actions
name: Ozkary Brand A CI/CD
on:
push:
branches:
- brand-a
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- brand-a
@ozkary
ozkary / routeLoader.ts
Last active March 22, 2022 14:44
Route loader when using lazy loading and dynamic imports to manage ChunkLoadErrors
/**
* @file routes/routeLoader.ts
* @description lazy loading of routes.
*
* @author ogarcia (ozkary)
*
*/
/**
* Use this route loader when using lazy loading and dynamic imports
@ozkary
ozkary / continent-names.xml
Last active October 22, 2021 16:04
API Management transforms a SOAP API into JSON API
<policies>
<inbound>
<base />
<rewrite-uri template="/websamples.countryinfo/CountryInfoService.wso" copy-unmatched-params="false" />
<set-body template="liquid">
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns="http://www.oorsprong.org/websamples.countryinfo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<ListOfContinentsByName>
</ListOfContinentsByName>
</soap:Body>
@ozkary
ozkary / logger-component-error.ts
Last active March 22, 2022 14:39
AppInsights React Logger Service
// import the operations from logger
import { error, audit } from '../logger';
/**
* Sample code to log an error from a handled exception
* send the message asychronously
*/
try {
// call an operation that can raise errors