Skip to content

Instantly share code, notes, and snippets.

@taxilian
taxilian / DialogManager.h
Created November 15, 2011 22:58
DialogManager abstraction for FireBreath
#ifndef DialogManager_h__
#define DialogManager_h__
#include <boost/noncopyable.hpp>
#include <boost/function.hpp>
#include "BrowserHost.h"
typedef boost::function<void (const std::string&)> PathCallback;
namespace FB { class PluginWindow; }
@Calrion
Calrion / README.md
Created December 8, 2011 04:32
Mount Stop Daemon (for Mac OS X)

Mount Stop Daemon

Mount Stop Daemon is a command-line utility for Mac OS X that prevents volumes from being automatically mounted. Any and all new volumes will not be automatically mounted while mountstopd is running.

Usage

@kbinani
kbinani / GetModuleFileName.cpp
Last active September 12, 2019 01:22
GetModuleFileName (WinAPI) equivalent implementation for OSX
#include <mach-o/dyld.h>
#include <mach-o/getsect.h>
#include <dlfcn.h>
#include <string>
std::string GetModuleFileName(const void *module)
{
if (!module) { return std::string(); }
uint32_t count = _dyld_image_count();
for (uint32_t i = 0; i < count; ++i) {
@pilotmoon
pilotmoon / OS X Window Levels (10.10)
Last active November 1, 2019 06:01
OS X window levels
2015-01-16 10:09:00.037 WindowLevels[72050:11476115] 0 (kCGBaseWindowLevelKey) : -2147483648
2015-01-16 10:09:00.039 WindowLevels[72050:11476115] 1 (kCGMinimumWindowLevelKey) : -2147483643
2015-01-16 10:09:00.039 WindowLevels[72050:11476115] 2 (kCGDesktopWindowLevelKey) : -2147483623
2015-01-16 10:09:00.039 WindowLevels[72050:11476115] 3 (kCGBackstopMenuLevelKey) : -20
2015-01-16 10:09:00.039 WindowLevels[72050:11476115] 4 (kCGNormalWindowLevelKey) : 0
2015-01-16 10:09:00.040 WindowLevels[72050:11476115] 5 (kCGFloatingWindowLevelKey) : 3
2015-01-16 10:09:00.040 WindowLevels[72050:11476115] 6 (kCGTornOffMenuWindowLevelKey) : 3
2015-01-16 10:09:00.040 WindowLevels[72050:11476115] 7 (kCGDockWindowLevelKey) : 20
2015-01-16 10:09:00.040 WindowLevels[72050:11476115] 8 (kCGMainMenuWindowLevelKey) : 24
2015-01-16 10:09:00.040 WindowLevels[72050:11476115] 9 (kCGStatusWindowLevelKey) : 25
<#
This script allows modification of local MDM policies.
It is based on Microsoft Documentation: https://docs.microsoft.com/en-us/windows/client-management/mdm/using-powershell-scripting-with-the-wmi-bridge-provider
Author: Cornelius Schuchardt, SoftEd Systems GmbH
Must be executed using SYSTEM account.
#>
$namespaceName = "root\cimv2\mdm\dmmap"
$className = "MDM_Policy_Config01_Connectivity02"
@arthuredelstein
arthuredelstein / 18101_windows_2.cpp
Created November 12, 2017 08:55
Intercepting the Open button
#include <windows.h>
#include <shobjidl.h>
#include <stdio.h>
void test_ifiledialog()
{
HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED |
COINIT_DISABLE_OLE1DDE);
if (SUCCEEDED(hr))
{
#include <wx/wx.h>
#include <wx/datectrl.h>
#ifdef __WXMSW__
#include <wx/msw/wrapcctl.h>
#endif;
// wxDatePickerNoToday is a wxDatePickerCtrl with wxDP_DROPDOWN style
// which on MSW does not display the today circle and today date
// in the drop down calendar
@xorrior
xorrior / messagebox.m
Last active November 14, 2021 05:25
Installer Plugin that pops a message box to the user
//
// MyInstallerPane.m
// messagebox
//
// Created by Chris Ross on 1/23/18.
// Copyright © 2018 testplugin. All rights reserved.
//
/*
This should be in MyInstallerPane.h
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <AppKit/AppKit.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <Carbon/Carbon.h>
#import <CoreFoundation/CoreFoundation.h>
static CFStringRef CopyCurrentConsoleUsername(SCDynamicStoreRef store)
{
CFStringRef result;
@jakoch
jakoch / installer.iss
Created March 20, 2016 23:39
InnoSetup Uninstall by deleting the application folder
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
// warn the user, that his working folder is going to be deleted and projects might get lost
if (CurUninstallStep = usUninstall) then begin
if MsgBox('***WARNING***'#13#10#13#10 +
'The installation folder is [ '+ ExpandConstant('{app}') +' ].'#13#10 +
'You are about to delete this folder and all its subfolders,'#13#10 +
'including [ '+ ExpandConstant('{app}') +'\important_projects_folder ], which may contain your projects.'#13#10#13#10 +