Skip to content

Instantly share code, notes, and snippets.

View 0xced's full-sized avatar

Cédric Luthi 0xced

View GitHub Profile
@0xced
0xced / NSString.m
Created April 1, 2012 12:24
Reverse-engineered implementation of -[NSString isEqual:] and -[NSString isEqualToString:]
/*
* Most NSString instances will actually be __NSCFString instances, so here are both NSString and __NSCFString implementations.
* If you know how to create an NSString instance whose class is actually NSString please let me know.
* Other possible concrete subclasses of NSString are: NSConstantString, __NSCFConstantString, NSPathStore2, NSSimpleCString and __NSLocalizedString.
*/
// CoreFoundation.framework 635.19.0 (Mac OS X 10.7.3)
@implementation NSObject
- (BOOL) isNSString__
@0xced
0xced / FodyWeavers.xml
Last active March 7, 2024 18:49
Single exe using Microsoft.EntityFrameworkCore.Sqlite on .NET Framework 4.7.2
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<Costura />
</Weavers>
@0xced
0xced / UIDevice+serialNumber.h
Last active February 7, 2024 06:14
UIDevice+serialNumber
/*
* Adds the serialNumber property to the UIDevice class
*
* The implementation uses undocumented (for iOS) IOKit functions,
* so handle with caution and be prepared for nil.
*/
#import <UIKit/UIDevice.h>
@interface UIDevice (serialNumber)
@0xced
0xced / LICENSE
Created February 4, 2024 15:35 — forked from noelbundick/LICENSE
Azure Container Instances as SOCKS proxy
MIT License
Copyright (c) 2018 Noel Bundick
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
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@0xced
0xced / CopyLaunchedApplicationsInFrontToBackOrder.c
Created August 7, 2009 14:06
Get an array of running applications ordered by last use
#import <Carbon/Carbon.h>
#import <dlfcn.h>
/*
* Returns an array of CFDictionaryRef types, each of which contains information about one of the processes.
* The processes are ordered in front to back, i.e. in the same order they appear when typing command + tab, from left to right.
* See the ProcessInformationCopyDictionary function documentation for the keys used in the dictionaries.
* If something goes wrong, then this function returns NULL.
*/
CFArrayRef CopyLaunchedApplicationsInFrontToBackOrder(void)
@0xced
0xced / Emoji.json
Last active November 22, 2023 15:53
Extract emoji by category using the EmojiFoundation framework
{
"People" : [
"😀",
"😃",
"😄",
"😁",
"😆",
"😅",
"😂",
"🤣",
@0xced
0xced / FromHeader.cs
Last active November 1, 2023 06:20
[FromHeader] parameter binding and attribute for ASP.NET Web API + Swashbuckle integration
using System;
using System.ComponentModel;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Controllers;
using System.Web.Http.Metadata;
@0xced
0xced / UIClassSwapper.m
Last active November 1, 2023 01:41
Reverse engineered implementation of -[UIClassSwapper initWithCoder:]
@implementation UIClassSwapper
- (instancetype) initWithCoder:(UINibDecoder *)decoder
{
NSString *className = [decoder decodeObjectForKey:@"UIClassName"];
NSString *originalClassName = [decoder decodeObjectForKey:@"UIOriginalClassName"];
Class class = NSClassFromString(className);
Class originalClass = NSClassFromString(originalClassName);
Package Id Version Commands
-------------------------------------------------------------------------------------------
alias 0.1.3 assemblyalias
cake.tool 1.3.0 dotnet-cake
codecov.tool 1.13.0 codecov
csharprepl 0.3.4 csharprepl
diffenginetray 8.3.0 DiffEngineTray
docfx 3.0.0-beta1-1050-g0d0102792b docfx
dotnet-ef 6.0.0 dotnet-ef
dotnet-project-licenses 2.3.6 dotnet-project-licenses
@0xced
0xced / NSRunningApplication+DockIcon.h
Created March 15, 2012 16:00
NSRunningApplication category to dynamically show and hide any running application icon in the Dock
//
// Created by Cédric Luthi on 2011-05-03
// Copyright 2011-2012 Cédric Luthi. All rights reserved.
//
#import <AppKit/AppKit.h>
@interface NSRunningApplication (DockIcon)
- (BOOL) setDockIconHidden_xcd:(BOOL)dockIconHidden;