Skip to content

Instantly share code, notes, and snippets.

@alexvy86
alexvy86 / SQL Server object lookup by text
Last active October 9, 2015 03:48
Look for DB objects with some text in them
DECLARE @textToLookFor VARCHAR(200)
SET @textToLookFor = 'InventoryTransaction'
SELECT * FROM INFORMATION_SCHEMA.ROUTINES
WHERE OBJECT_DEFINITION(OBJECT_ID(ROUTINE_SCHEMA + '.' + ROUTINE_NAME)) LIKE '%' + @textToLookFor + '%'
SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE OBJECT_DEFINITION(OBJECT_ID(TABLE_SCHEMA + '.' + TABLE_NAME)) LIKE '%' + @textToLookFor + '%'
@alexvy86
alexvy86 / SQL Server table size statistics
Created August 23, 2012 06:14
See row and size statistics for all tables in a DB in SQL Server
SET NOCOUNT ON
DBCC UPDATEUSAGE(0)
-- DB size.
EXEC sp_spaceused
-- Table row counts and sizes.
CREATE TABLE #t
(
@alexvy86
alexvy86 / Deadlock debug trace flags
Created August 23, 2012 06:14
Turn on trace flags for deadlock debugging
DBCC TRACEON(1204,-1)
DBCC TRACEON(1222,-1)
DBCC TRACEON(3605,-1)
DBCC TRACESTATUS

Keybase proof

I hereby claim:

  • I am alexvy86 on github.
  • I am alexvy86 (https://keybase.io/alexvy86) on keybase.
  • I have a public key whose fingerprint is 8B92 0942 5ED6 F676 80FE CC2D 1AC5 F9C3 B669 67C4

To claim this, I am signing this object:

@alexvy86
alexvy86 / stuff-to-move-out-of-C-drive.md
Last active July 16, 2020 03:31
Stuff to move out of the C:\ drive

Stuff to move out of the C:\ drive

This is a compilation of things that by default are saved to the C:\ drive but can be easily told to move somewhere else. It can help to minimize disk usage for SSDs (which the OS disk usually is). Mostly focused on development stuff, since that's mostly what I've seen occupying space in my drives, but I'll add other things as well.

npm package cache

Set the npm_config_cache environment variable to the new path (e.g. G:\AppData\Roaming\npm-cache)

Or run npm config set cache "<new-path>" --global .

@alexvy86
alexvy86 / log.txt
Created August 18, 2020 23:36
Terraform logs - fails to import Azure Traffic Manager resource
2020-08-18T16:00:59.444-0500 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: [DEBUG] Determining which Resource Providers require Registration
2020-08-18T16:00:59.444-0500 [DEBUG] plugin.terraform-provider-azurerm_v2.23.0_x5.exe: [DEBUG] All required Resource Providers are registered
2020/08/18 16:00:59 [TRACE] [walkImport] Exiting eval tree: provider.azurerm
2020/08/18 16:00:59 [TRACE] vertex "provider.azurerm": visit complete
2020/08/18 16:00:59 [TRACE] dag/walk: visiting "azurerm_traffic_manager_profile.traffic-manager (import id \"/subscriptions/<my-subscription-id>/resourcegroups/my-rg/providers/Microsoft.Network/trafficmanagerprofiles/my-traffic-manager-profile\")"
2020/08/18 16:00:59 [TRACE] dag/walk: visiting "data.azurerm_resource_group.resource_group"
2020/08/18 16:00:59 [TRACE] vertex "azurerm_traffic_manager_profile.traffic-manager (import id \"/subscriptions/<my-subscription-id>/resourcegroups/my-rg/providers/Microsoft.Network/trafficmanagerprofiles/my-traffic-manager-profile\")": start
import { createDevtoolsLogger, initializeDevtools } from "@fluidframework/devtools/beta";
// Create a logger to pass to AzureClient and to Devtools
const logger = createDevtoolsLogger();
// Pass the logger in properties when instantiating an AzureClient
const clientProps = {
connection: connectionConfig,
logger,
};
// If the app is in a `createNew` state - no containerId, and the container is detached, we attach the container.
// This uploads the container to the service and connects to the collaboration session.
if (container.attachState === AttachState.Detached) {
containerId = await container.attach();
// The newly attached container is given a unique ID that can be used to access the container in another session.
// This adds that id to the url.
history.replaceState(undefined, "", "#" + containerId);
} else {
// When loading an existing container...