Skip to content

Instantly share code, notes, and snippets.

@Memphizzz
Memphizzz / gist:6b490ca8e2477704a30f56ca0d489575
Created November 13, 2017 18:15
ActiveDirectoryHelper and Info
public class ActiveDirectoryHelper : IDisposable
{
private readonly DirectoryEntry _de;
private readonly DirectorySearcher _searcher;
public ActiveDirectoryHelper(string ldapPath)
{
_de = new DirectoryEntry(ldapPath);
_searcher = new DirectorySearcher(_de);
}
function rs
set PREV_CMD (history | head -1)
echo Running: sudo $PREV_CMD
sudo $PREV_CMD
end
@Memphizzz
Memphizzz / Tmp.cs
Last active December 15, 2020 18:39
Helpers.ShowFileProperties(sourcePath);
IntPtr ptr = IntPtr.Zero;
var title = IsDirectory(sourcePath) ? new DirectoryInfo(sourcePath).Name : new FileInfo(sourcePath).Name;
title += " Properties";
while (ptr == IntPtr.Zero)
ptr = Helpers.FindWindow("#32770", title);
foreach (TreeViewItem messages in Messages)
{
foreach (TreeViewItem item in messages.Items)
{
s.Add(item.Header.ToString());
}
}