Skip to content

Instantly share code, notes, and snippets.

View albertvaka's full-sized avatar
🥐
Doing stuff

Albert Vaca Cintora albertvaka

🥐
Doing stuff
View GitHub Profile
@albertvaka
albertvaka / ~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
Last active March 12, 2024 15:03
Powershell 'cd' that behaves properly: zero args bring you home, passing '-' brings you to the previous dir
del alias:cd -Force # Remove builtin cd alias to Set-Location
function cd {
$pwd = Get-Location
if ($args.Count -eq 0) {
Set-Location ~
} elseif ($args[0] -eq "-") {
Set-Location @global:OLDPWD
} else {
Set-Location @args
}
HashSet<string> GetCommonDatasetNames(string oldIdentityId, string newIdentityId){
HashSet<string> newNameSet = new HashSet<string>();
HashSet<string> oldNameSet = new HashSet<string>();
if(oldIdentityId != null && newIdentityId != null){
List<DatasetMetadata> newDatasets = GetDatasets(newIdentityId);
List<DatasetMetadata> oldDatasets = GetDatasets(oldIdentityId);
foreach(DatasetMetadata oldMetaData in oldDatasets){
oldNameSet.Add(oldMetaData.DatasetName);
}
foreach(DatasetMetadata newMetaData in newDatasets){
@albertvaka
albertvaka / solid_backend.patch
Created August 16, 2013 15:13
Solid backend to read battery info from KDE Connect
diff --git a/solid/solid/CMakeLists.txt b/solid/solid/CMakeLists.txt
index a7f1f07..c2099dc 100644
--- a/solid/solid/CMakeLists.txt
+++ b/solid/solid/CMakeLists.txt
@@ -287,6 +287,15 @@ if(NOT WIN32 AND NOT APPLE)
backends/upower/upowergenericinterface.cpp
)
+ message(STATUS "Building Solid PhonePower backend." )
+ set(solid_LIB_SRCS ${solid_LIB_SRCS}