Skip to content

Instantly share code, notes, and snippets.

@mnaoumov
mnaoumov / Script.js
Created January 16, 2023 03:40
Obsidian LeetCode replace urls with problem notes
(async () => {
debugger;
const mdFiles = app.vault.getMarkdownFiles().filter(f => f.path.startsWith('Programming/LeetCode/'));
const problemFiles = mdFiles.filter(f => f.path.startsWith('Programming/LeetCode/Problems/'));
const urlNoteMap = new Map();
for (const problemFile of problemFiles) {
@mnaoumov
mnaoumov / Date.md
Last active December 13, 2022 18:15
Obsidian Templater date creation

<% await tp.user.date(tp) %>

@mnaoumov
mnaoumov / build.cmd
Last active October 18, 2019 00:10
Windows case-insensitive file names = nightmares with Node.JS
@node "%~dp0\script.js"
@mnaoumov
mnaoumov / 0-ApexSQL Refactor ELSE IF feature request.md
Last active December 9, 2018 09:09
ApexSQL Refactor ELSE IF feature request

ApexSQL Refactor has setting Always use BEGIN and END in IF statements

It doesn't work well for ELSE IF statements and includes unnecessary nesting

Even worse, it includes semicolons after END on subsequent formatting which makes SQL invalid

@mnaoumov
mnaoumov / Setup.cmd
Last active April 28, 2018 12:43
Setup environment
powershell -NoExit -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri https://gist.githubusercontent.com/mnaoumov/fe950c42fca4ad2482df2878b3bf9aaa/raw/Setup.ps1 -UseBasicParsing | Invoke-Expression"
@mnaoumov
mnaoumov / git-trace-https.txt
Created May 26, 2014 23:57
git trace https
C:\dev\1> $env:GIT_TRACE=1
C:\dev\1> $env:GIT_CURL_VERBOSE=1
C:\dev\1> git clone -v https://github.com/gitextensions/gitextensions.git
trace: built-in: git 'clone' '-v' 'https://github.com/gitextensions/gitextensions.git'
Cloning into 'gitextensions'...
trace: run_command: 'git-remote-https' 'origin' 'https://github.com/gitextensions/gitextensions.git'
* Couldn't find host github.com in the _netrc file; using defaults
* Adding handle: conn: 0x2150398
* Adding handle: send: 0
* Adding handle: recv: 0
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest
function Replace-ViewState([string] $content)
{
if (-not ($content.Contains("ViewState[")))
{
return $content
}
// Name: MicrosoftAjaxWebForms.debug.js
// Assembly: System.Web.Extensions
// Version: 4.0.0.0
// FileVersion: 4.0.30319.36278
//-----------------------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------
// MicrosoftAjaxWebForms.js
// Microsoft AJAX ASP.NET WebForms Framework.
Type._registerScript("MicrosoftAjaxWebForms.js", [
<!doctype html>
<html>
<head>
</head>
<body>
<script>
var iframe = document.createElement("iframe");
iframe.src = "http://rawgit.com/mnaoumov/0e5ea2c57bdecf3603e6/raw/09bd76f62e474302d7a7fe6dafb20234acef9fbd/test.html";
setTimeout(function removeIframe() {
@mnaoumov
mnaoumov / gist:4575495
Last active December 11, 2015 08:48
git log strange behavior
git log --oneline --decorate master..1.0
ec9988c (tag: build-1.3.2616.0, 1.0) Merge branch '1.0' into mobile
e29326d Merge remote-tracking branch 'origin/1.0' into 1.0
b716f00 Merge branch '1.0' into mobile
faa9bc3 TFS9437 send down correct brand id
25ae928 Fix js hint errors
aef6132 Merge branch 'mobile' of git.f-dev.net:otp into mobile
1d9691a TFS9112 Fix Bug in Mobile:Customer details- Navigation is not working on Time zone page.
50e31c3 Merge branch 'mobile' of git.f-dev.net:otp into mobile