Skip to content

Instantly share code, notes, and snippets.

@sandipchitale
sandipchitale / build-anyfail.gradle
Created December 21, 2021 04:07
Anyfail #gradle #fail
ext {
__anyFailed = false;
__failedTasks = [];
__failures = [];
__allowFail = [];
}
gradle.taskGraph.afterTask { Task task, TaskState state ->
if (project.ext.__allowFail.contains(task.name)) {
if (task.state.failure != null) {
@sandipchitale
sandipchitale / gradledebug.bat
Last active December 25, 2021 23:49
Run gradle build script in debug mode #gradle
.\gradlew --no-daemon -Dorg.gradle.debug=true
@sandipchitale
sandipchitale / filesinchangelist.ts
Last active December 29, 2021 02:07
Get files in a changelist #perforce #p4vjs
declare var p4vjs: any;
(async () => {
const workspace = await p4vjs.getClient();
let workspaceRoot = '';
const workspaceP = document.getElementById('workspace');
if (workspaceP) {
workspaceP.innerText = workspace;
}
const info = await p4vjs.p4([
@sandipchitale
sandipchitale / outputchannel.ts
Last active January 3, 2022 07:01
Create output channel for extention #vscode #outputchannel
// Create
const outputChannel = vscode.window.createOutputChannel(context.extension.id.replace('sandipchitale.', ''));
// Use
outputChannel?.appendLine('-');
@sandipchitale
sandipchitale / showprogress.ts
Last active January 4, 2022 03:54
Show progress #vscode #progress
vscode.window.withProgress({
location: vscode.ProgressLocation.Notification,
title: `Progress message`
}, (progress, token) => {
return new Promise((resolve, reject) => {
});
})
@sandipchitale
sandipchitale / showOpenWith.cmd
Last active January 10, 2022 06:08
Show Open With Dialog
REM Show Open With Dialog for file
rundll32.exe shell32,OpenAs_RunDLL %*
@sandipchitale
sandipchitale / gradle-explorer.gradle
Last active January 21, 2022 06:58
objectexplorer #gradle
import javax.swing.plaf.basic.BasicLookAndFeel
import java.awt.event.*
import javax.swing.*
import javax.swing.tree.*
import java.util.concurrent.CountDownLatch
def addChild(DefaultMutableTreeNode p, String name, def value, int depth = 0) {
if (depth < 4) {
DefaultMutableTreeNode c = new DefaultMutableTreeNode("${name}: ${value}");
p.add(c)
@sandipchitale
sandipchitale / taskbar-position.hack
Last active February 3, 2022 23:53
Taskbar position hack #windows11
Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3
Administrator cmd:
taskkill /f /im explorer.exe
start explorer.exe
@sandipchitale
sandipchitale / foo.html
Last active February 17, 2022 02:34
cssbattle starter #css #cssbattle
<div class="center"></div>
<div class="center"></div>
<style>
* {
box-sizing: border-box;
}
body {
display: grid;
grid-template-columns: auto;
@sandipchitale
sandipchitale / build.gradle
Last active December 9, 2022 04:44
Configure http proxy #powershell #proxy
task generateHttpProxy() {
doFirst {
println "Paste the above sysprops to your gradle.properties in your project or ${project.gradle.gradleUserHomeDir}${File.separator}gradle.properties"
}
}
defaultTasks 'generateHttpProxy'