Skip to content

Instantly share code, notes, and snippets.

@patmanv
patmanv / VS Code Preferences and Extensions
Created September 7, 2020 23:40
VS Code Preferences and Extensions
ext install ms-vscode.csharp (C#)
{
"editor.multiCursorModifier": "ctrlCmd",
"editor.links": false,
"workbench.colorCustomizations": {
"editor.findMatchBackground": "#ff0000",
"editor.findMatchHighlightBackground": "#40ccc5",
"editor.selectionHighlightBackground": "#e7e416"
@patmanv
patmanv / MainWindow.xaml
Created August 13, 2020 23:46
WPF Boilerplate
<Window x:Class="WPFDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WPFDemo"
mc:Ignorable="d"
Title="WPF Demo" Height="450" Width="500"
FontSize="18" FontFamily="Segoe UI">
<Grid>
-- find tables by name
SELECT *
FROM sys.objects
WHERE type = 'U'
AND [name] LIKE '%xxx%'
ORDER BY 1
-- find tables with specified column
SELECT DISTINCT o.name
FROM sys.columns c
@patmanv
patmanv / bsindex.html
Last active August 29, 2015 14:20
Bootstrap Html Boilerplate
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<!-- TODO ref cdn here and at the bottom -->
<link href="css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
@patmanv
patmanv / RedOracleUser.sql
Created August 25, 2014 09:53
Create Oracle user for Red
-- USER SQL
CREATE USER <UserName> IDENTIFIED BY <password>
DEFAULT TABLESPACE "RED_METADATA"
TEMPORARY TABLESPACE "TEMP";
-- ROLES
GRANT "RESOURCE" TO <UserName> ;
ALTER USER <UserName> DEFAULT ROLE "RESOURCE";
Note: All alpha characters in the user name should be in caps
@patmanv
patmanv / RedMeta.sql
Last active February 12, 2024 21:12
Red Meta Queries
----------------------------------------------------------------------------------------------------
-- <<< system tables >>>
----------------------------------------------------------------------------------------------------
-- get RED meta data tables
SELECT *
FROM sys.objects
WHERE (name LIKE 'ws_%' or name LIKE 'dss_%ac%' )
AND type = 'U'
ORDER BY 1
@patmanv
patmanv / Age.sql
Created August 25, 2014 09:50
Current Age (sql)
DECLARE @startDate DATETIME = '20130703'
DECLARE @endDate DATETIME = '20140703'
IF ((MONTH(@endDate) * 100 + DAY(@endDate)) - (MONTH(@startDate) * 100 + DAY(@startDate))) >= 0
SELECT DATEDIFF(YEAR,@startDate, @endDate)
ELSE
SELECT DATEDIFF(YEAR,@startDate, @endDate) - 1