Skip to content

Instantly share code, notes, and snippets.

View igorpopovio's full-sized avatar
☺️
Working

Igor Popov igorpopovio

☺️
Working
View GitHub Profile
@igorpopovio
igorpopovio / build.gradle
Created May 6, 2014 13:31
List all files (including transitive stuff) for a specific dependency.
repositories { mavenCentral() }
configurations { libs }
dependencies { libs 'org.hibernate:hibernate-core:4.3.5.Final' }
configurations.libs.dependencies.each { dependency ->
def myFiles = configurations.libs.files dependency
myFiles.each { println it }
}
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction
import liquibase.integration.commandline.Main
apply plugin: LiquibasePlugin
buildscript {
@igorpopovio
igorpopovio / download-with-name.ps1
Created July 16, 2014 13:56
Download a file in PowerShell using the wget style - guess filename, don't hard-code anything!
function DownloadFileFrom($link) {
$filename = [System.IO.Path]::GetFileName($link)
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($link, $filename)
}
# inspired from this article:
# http://windowsitpro.com/powershell/easily-finding-special-paths-powershell-scripts
$folders = [Environment+SpecialFolder]::GetNames([Environment+SpecialFolder])
foreach ($folder in $folders) {
$location = [Environment]::GetFolderPath($folder)
$specialFoldersTable = New-Object PSObject
$specialFoldersTable | Add-Member FolderName $folder
param (
[string] $MSBUILD = "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe",
[string] $GIT = "C:\Program Files (x86)\Git\bin\git.exe"
)
$nugetCachesDirectory = "$env:LOCALAPPDATA\NuGet\Cache"
$buildDirectory = "bin"
$solutionFile = "GildedRoseKata.sln"
$configuration = "Release"
$platform = "Any CPU"
@igorpopovio
igorpopovio / portals.svg
Created August 27, 2014 19:53
SVG project
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@igorpopovio
igorpopovio / InstallScript registry functions
Last active June 2, 2022 14:03
Small example on how to get some information from the registry...
#include "Ifx.h"
#define TITLE "RegDBSetKeyValueEx & RegDBGetKeyValueEx"
export prototype MyFunction(HWND);
function MyFunction(hMSI)
STRING szKey, szNumName, szNumValue, svNumValue, szTitle, szMsg;
NUMBER nType, nSize, nvType, nvSize;
begin
szKey = "SOFTWARE\\Wow6432Node\\Company Ltd.\\COMPANY\\20144";
@igorpopovio
igorpopovio / ClickCountingApp.java
Last active January 12, 2018 10:45
An example of a very simple Java swing application.
package io.igorpopov;
import javax.swing.*;
import java.awt.event.*;
public class ClickCountingApp {
public static void main(String args[]) {
JButton button = new JButton("Button never pressed...");
button.addActionListener(new ButtonListener());
function Main() {
RetryCommand `
-maxRetries 5 `
-delayInSeconds 0 `
-command { cmd /c $SIGNTOOL sign /v /debug /sm /t $TIMESTAMP_URL $files }
RetryCommand `
-maxRetries 5 `
-delayInSeconds 3 `
-command { . $INSTALLSHIELD $arguments }
@igorpopovio
igorpopovio / Shorten-Path.ps1
Created August 17, 2015 13:01
Function to shorten path in case it's too long (doesn't require extra permissions for folders)
function ShortenPath($longPath) {
$id = ([guid]::NewGuid() -split '-')[0]
$shortPath = "C:\temp\$id"
cmd /c mklink /D /J $shortPath $longPath | Out-Null
return $shortPath
}