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 / community-standup-explained.cs
Created January 13, 2023 10:28 — forked from jaredpar/community-standup-explained.cs
This is the code I demonstrated at the .NET Community Standup on 2023/1/12 with comments to explain how it works.
using System;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
#nullable disable
// The stand up link https://www.youtube.com/watch?v=jaPk6Nt33KM
// String vs. string
It indeed seems to work! ;)
Have fun!
@igorpopovio
igorpopovio / 1 – myers (default) algorithm.diff
Created December 1, 2015 17:11 — forked from roryokane/1 – myers (default) algorithm.diff
Comparison between Git diff algorithms: myers (default) vs. patience (example favors patience)
diff --git a/file.c b/file.c
index 6faa5a3..e3af329 100644
--- a/file.c
+++ b/file.c
@@ -1,26 +1,25 @@
#include <stdio.h>
-// Frobs foo heartily
-int frobnitz(int foo)
+int fib(int n)
@igorpopovio
igorpopovio / boxstarter-work.ps1
Created October 19, 2015 07:48
Setup work computer
# How to use:
# with autorestart: start http://boxstarter.org/package/nr/url?TEXT_FILE_URL
# without restart: start http://boxstarter.org/package/url?TEXT_FILE_URL
# example: start http://boxstarter.org/package/nr/url?https://gist.github.com/user/id/raw/hash/file.txt
# More info:
# http://boxstarter.org/Learn/WebLauncher
Update-ExecutionPolicy Unrestricted
@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
}
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 / 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());
@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 / portals.svg
Created August 27, 2014 19:53
SVG project
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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"