This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function file-history() { | |
if [ -z "$2" ]; then | |
file_pattern="$(basename "$1")" | |
else | |
file_pattern="$2" | |
fi | |
git log --oneline --abbrev-commit --follow "$1" | | |
fzf --ansi --preview "commit=\$(echo {1} | cut -d' ' -f1); \ | |
file=\$(git show --pretty='' --name-only \$commit | grep -i '$file_pattern'); \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# DuplicatedFrameworksRemover.rb | |
# Created by Wojciech Kulik on 14/09/2021. | |
# | |
# Description: | |
# This code fixes warnings caused by linking the same frameworks in multiple targets. | |
# | |
# Sample warning: "objc[1111]: Class XXXX is implemented in both path/FrameworkName1 and path/FrameworkName2. | |
# One of the two will be used. Which one is undefined." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// FixedComboBox.swift | |
// Snippety | |
// | |
// Created by Wojciech Kulik on 03/09/2020. | |
// Copyright © 2020 Wojciech Kulik. All rights reserved. | |
// | |
import Cocoa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DllImport("pdh.dll", SetLastError = true, CharSet = CharSet.Unicode)] | |
static extern UInt32 PdhLookupPerfNameByIndex(string szMachineName, uint dwNameIndex, StringBuilder szNameBuffer, ref uint pcchNameBufferSize); | |
PerformanceCounter GetSingleInstanceCounter(string englishCategoryName, string englishCounterName) | |
{ | |
// Try first with english names | |
try | |
{ | |
return new PerformanceCounter(englishCategoryName, englishCounterName); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the order is important, if we want to support bitwise OR: IPv4 | IPv6 equals IPv4and6 | |
public enum IpVersion | |
{ | |
None, | |
IPv4, | |
IPv6, | |
IPv4and6 | |
} | |
public async Task<IpVersion> GetCurrentIpVersion() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the order is important, if we want to support bitwise OR: IPv4 | IPv6 equals IPv4and6 | |
enum IpVersion | |
{ | |
None, | |
IPv4, | |
IPv6, | |
IPv4and6 | |
} | |
IpVersion GetConfiguredProtocolVersions(ConnectionProfile profile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <thread> | |
#include <array> | |
#include <vector> | |
#include <mutex> | |
#include <string> | |
#include <condition_variable> | |
#include <queue> | |
#include <algorithm> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
struct Field | |
{ | |
char c; | |
int length; | |
Field * previous; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
struct Edge | |
{ | |
int a, b; | |
int weight; | |
}; | |
struct Vertex | |
{ |
NewerOlder