Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@DHowett
DHowett / zip_lh.hexpat
Last active December 20, 2023 17:13
ImHex zip.hexpat with local header support
#pragma description End of Central Directory Header, Central Directory File Headers
#pragma MIME application/zip
#include <std/mem.pat>
#include <std/math.pat>
struct EndOfCentralDirectory {
u32 headerSignature [[color("00000000")]];
u16 diskNum [[comment("Number of this disk "), name("Disk Number")]];
@DHowett
DHowett / Program.cs
Created May 24, 2023 17:09
IWebAccount2 - C#/WinRT
using Windows.Security.Credentials;
using WinRT;
namespace CredentialCsWinRtTest {
internal class Program {
static void Main(string[] args) {
Windows.Security.Credentials.WebAccount foo = null /* or somehow get it */;
Windows.Security.Credentials.IWebAccount2 webAccount2 = foo.As<IWebAccount2>();
// if webaccount2 is not null . . .
webAccount2.SignOutAsync("clientId"); // do something with the async task actually
2016-06-05 14:30:07,345 [DEBUG] - Configured chocolatey.infrastructure.logging.log4net.config.xml from assembly choco, Version=0.9.10.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb
2016-06-05 14:30:07,345 [DEBUG] - Configured chocolatey.infrastructure.logging.log4net.config.xml from assembly choco, Version=0.9.10.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb
2016-06-05 14:30:07,364 [DEBUG] - XmlConfiguration is now operational
2016-06-05 14:30:07,508 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\config\chocolatey.config.update".
2016-06-05 14:30:07,513 [INFO ] - ============================================================
2016-06-05 14:30:07,519 [INFO ] - Chocolatey v0.9.10-beta1-281-gfd2eea1
2016-06-05 14:30:07,529 [DEBUG] - Chocolatey is running on Windows v 10.0.14355.0
2016-06-05 14:30:07,532 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2016-06-05 14:30:07,534 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2016-0
@DHowett
DHowett / emoji.m
Last active August 29, 2015 14:04 — forked from siqin/gist:4201667
Strip Emoji (NSString)
#include <unicode/utf8.h>
// This only covers two of the common Emoji ranges, but the Emoji character set is broken
// up across seven different regions.
@implementation NSString (StripEmoji)
- (NSString *)stringByRemovingEmoji {
NSData *d = [self dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO];
if(!d) return nil;
const char *buf = d.bytes;
unsigned int len = [d length];
char *s = (char *)malloc(len);
@DHowett
DHowett / Tweak.xm
Last active December 16, 2015 21:09
@interface MyAwesomeSingletonPleaseDontNameMeThis: NSObject
+ (id)sharedInstance;
- (void)registerForNotifications;
@end
@implementation MyAwesomeSingletonPleaseDontNameMeThis
+ (id)sharedInstance {
static id _sh;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
@DHowett
DHowett / .zshrc
Created February 20, 2011 00:05 — forked from rpetrich/.bash_profile
Shell Bookmarks for ZSH
function _uh { [[ -z $DEV ]]; return $? }
function userroot {
if ! _uh; then echo $DEV;
else echo $HOME; fi
}
function _sdirname {
echo "$(userroot)/.sdirs"
}
#!/bin/sh
SDK=`dirname $0`
SCRIPT=`basename $0`
SDKPARENT=`dirname $SDK`
PLATFORM=`uname -sp`
if [ "$PLATFORM" = "Darwin i386" -o "$PLATFORM" = "Darwin x86_64" ]; then
echo "iPhone Toolchain installer script by rpetrich"
echo ""