Skip to content

Instantly share code, notes, and snippets.

Avatar

ePirat ePirat

View GitHub Profile
@MolecularMatters
MolecularMatters / main.cpp
Created Jul 26, 2022
VirtualAllocEx hang in Windows 10
View main.cpp
#include <Windows.h>
#include <stdio.h>
#include <type_traits>
#include <algorithm>
namespace pointer
{
template <typename T>
View stackwalk_with_symbols.sh
#!/bin/bash
MINIDUMP_PATH="${1}"
MINIDUMP_STACKWALK=$(which minidump_stackwalk)
if [ -z "$MINIDUMP_STACKWALK" ]; then
if [ -f "$HOME/.mozbuild/minidump_stackwalk/minidump_stackwalk" ]; then
MINIDUMP_STACKWALK="$HOME/.mozbuild/minidump_stackwalk/minidump_stackwalk"
else
printf "You need the minidump_stackwalk executable in your PATH or under ~/.mozbuild in order to run this script\n"
exit 1
@steventroughtonsmith
steventroughtonsmith / MRDMenuView.h
Created Mar 1, 2020
Simplified iOS menu view wired up to UIMenuBuilder
View MRDMenuView.h
//
// MRDMenuView.h
// MobileRadio
//
// Created by Steven Troughton-Smith on 29/02/2020.
// Copyright © 2020 High Caffeine Content. All rights reserved.
//
#import <UIKit/UIKit.h>
@chockenberry
chockenberry / Debug.swift
Last active Jul 20, 2021
Debug and release logging in Swift that's reminiscent of NSLog()
View Debug.swift
//
// Debug.swift
//
// Created by Craig Hockenberry on 3/15/17.
// Usage:
//
// SplineReticulationManager.swift:
//
@Akemi
Akemi / remote.swift
Created Jul 28, 2019
MPRemoteCommandCenter Test
View remote.swift
// call like "swift remote.swift"
import MediaPlayer
let centre = MPRemoteCommandCenter.shared()
let handler: (String) -> ((MPRemoteCommandEvent) -> (MPRemoteCommandHandlerStatus)) = { (name) in
return { (event) -> MPRemoteCommandHandlerStatus in
print("\(name)")
return .success
}
@catlan
catlan / Document.m
Last active Aug 7, 2019
Pages.app like moveToURL:completionHandler: impl. NSIsRelatedItemType key in Info.plist is required
View Document.m
- (void)moveToURL:(NSURL *)url completionHandler:(void (^ __nullable)(NSError * __nullable))completionHandler
{
NSError *error = nil;
NSURL *adjustedURL = nil;
if (![[url pathExtension] isEqualToString:@"testextension"]) {
adjustedURL = [url URLByAppendingPathExtension:@"testextension"];
}
View odeus.py
# runs under Python 2 (yes, I know...)
# required modules: pip install unicorn pefile
# this code is made available under the MIT license, as follows:
# Copyright (c) 2018 Ash Wolf
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@JoshCheek
JoshCheek / uninstall_snap_camera_mac_osx.sh
Last active Jun 22, 2022
How to uninstall Snap Camera on Mac OS X
View uninstall_snap_camera_mac_osx.sh
# these are reconstructed from a shell session without runnig them, so make
# sure you check that it's a sane thing to do before running it, I make no
# guarantees of fitness, and accept no liability. Run at your own risk.
sudo launchctl remove com.snap.SnapCameraRemover
rm -r ~/Library/Caches/Snap/
rm -r ~/Library/Caches/com.snap.SnapCamera/
rm -r ~/Library/Preferences/Snap/
rm ~/Library/Preferences/com.snap.SnapCamera.plist
rm ~/Library/Preferences/com.snap.Snap\ Camera.plist
sudo rm -rf /Applications/Snap\ Camera.app/
View cc.sh
#!/bin/bash
ROOT=output
CC=x86_64-linux-musl-g++
CFLAGS="
-nostdinc
-isystem $ROOT/x86_64-linux-musl/include/c++/7.2.0
-isystem $ROOT/x86_64-linux-musl/include/c++/7.2.0/x86_64-linux-musl
-isystem $ROOT/x86_64-linux-musl/include/c++/7.2.0/backward
-isystem $ROOT/x86_64-linux-musl/include/
View VLCWinCompile.md

Compile for Windows (64bit)

Pull the VideoLAN Docker container and run it in interactive mode with bash:

(The -v ~/docker:/root/shared maps /root/shared in the container to ~/docker on your machine to easily obtain the build results, so make sure ~/docker exists.)

docker pull registry.videolan.org:5000/vlc-debian-win64
docker run -v ~/docker:/root/shared -it registry.videolan.org:5000/vlc-debian-win64 /bin/bash