Skip to content

Instantly share code, notes, and snippets.

View rodionovd's full-sized avatar
🗿
I'm slow

Dmitry Rodionov rodionovd

🗿
I'm slow
View GitHub Profile
@LeoNatan
LeoNatan / LNHiddenStrings.hh
Last active September 3, 2024 09:37
Hidden Strings
/**
The MIT License (MIT)
Copyright (c) 2024 Léo Natan
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
@ivmirx
ivmirx / mute-mastodon.txt
Last active August 7, 2024 01:28
Filter list for Mastodon, based on mentalhealth.txt by @potatoqualitee
Disclaimer: many of those are extremely important but I believe that social media isn't fit to discuss them
## Politics ##
alt-right
bipartisan
Brexit
Capitol
CCP
China
CIA
@stephancasas
stephancasas / CGWindowDictionary.swift
Last active June 16, 2024 09:51
A convenience type for working with the CFDictionary values returned by CGWindowListCopyWindowInfo(_:, _:)
//
// CGWindowDictionary.swift
//
// Created by Stephan Casas on 11/2/23.
//
import Foundation;
import CoreGraphics;
import AppKit;
@stephancasas
stephancasas / CGCoordinateSpaces.swift
Created November 8, 2023 05:40
Extensions and utilities for working with CGPoint and CGRect across AppKit and CoreGraphics coordinate spaces.
//
// CGCoordinateSpaces.swift
//
// Created by Stephan Casas on 11/7/23.
//
import Foundation;
// MARK: - CGPoint
@mackuba
mackuba / core_data_wwdc.json
Last active May 5, 2024 16:03
List of all WWDC talks about Core Data since 2010
[
{
"id": "wwdc2010-118",
"title": "Mastering Core Data",
"description": "Core Data contains a vast set of advanced features to help you better manage your data and evolve your application over time. Master the techniques for working with data in your application, from being more efficient to doing more in the database and changing how you store your data over time. Take your Core Data knowledge to the next level.",
"links": [
[
"HD",
"https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2010__hd/session_118__mastering_core_data.mov"
],
// Usage should be fairly self-explanatory, just paste this in a header and use
// CRASH_WITH_MESSAGE("foobar") in your function.
// Example backtrace:
// Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
// 0 ??? 0x1022d8000 CRASHING IN test.c:20 (foobar) + 0
// 1 a.out 0x1022d7f60 main + 24
// 2 dyld 0x195f07e50 start + 2544
#define STRINGIFY(a) #a
#define CRASH_FUNCTION_NAME(file, line, message) "CRASHING IN " file ":" STRINGIFY(line) " (" message ")"
@saagarjha
saagarjha / swizzler.h
Last active December 25, 2023 18:06
Type-safe, RAII swizzler for Objective-C++
// Example usage:
// Swizzler<NSString *, NSDateFormatter *, NSDate *> NSDateFormatter_stringFromDate_ {
// NSDateFormatter.class, @selector(stringFromDate:), [&](auto self, auto date) {
// if ([NSCalendar.currentCalendar components:NSCalendarUnitWeekday fromDate:date].weekday == 4) {
// return @"It Is Wednesday My Dudes";
// } else {
// return NSDateFormatter_stringFromDate_(self, date);
// }
// }
// };
@pilky
pilky / SourceListTableCellView.swift
Created July 6, 2020 19:06
A source list cell that correct colours the label text of a drag image when selected
class SourceListTableCellView: NSTableCellView {
override var draggingImageComponents: [NSDraggingImageComponent] {
let components = super.draggingImageComponents
guard
self.backgroundStyle == .emphasized, //emphasized = selected
let textField = self.textField,
let newStyle = textField.attributedStringValue.mutableCopy() as? NSMutableAttributedString,
let labelIndex = components.firstIndex(where: { $0.key == .label })
else {
return components
@Catfish-Man
Catfish-Man / sethack.m
Created March 11, 2016 06:21
Demonstrating the trick of using stack-allocated mimics and sets for lookup tables instead of heap allocated keys and dictionaries
// Compile with clang -framework Foundation sethack.m
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
/*
CFHashBytes from http://www.opensource.apple.com/source/CF/CF-1153.18/CFUtilities.c
*/
#define ELF_STEP(B) T1 = (H << 4) + B; T2 = T1 & 0xF0000000; if (T2) T1 ^= (T2 >> 24); T1 &= (~T2); H = T1;
@steipete
steipete / gist:12c73d1b4dc1e933e15d
Last active June 26, 2019 22:48
Since some asked, these are the specs for my new hell machine. (https://twitter.com/steipete/status/697675524286627840). I got most of the parts on Amazon, keep an eye out for their warehouse deals, great savings for usually just damaged boxes.
Fractal Design Define S Black
Corsair CP-9020094-EU RMX Serie RM1000X ATX/EPS (if you don't do SLI 850W is good enough)
Asus ROG Maximus VIII Hero Gaming Mainboard
Corsair CMK32GX4M4A2400C14 Vengeance LPX 32GB
Intel Core™ i7-6700K
Noctua NH-D15S
Samsung Basic MZ-7KE1T0BW 850 Pro SSD (no space for an PCI-E version...)
Western Digital WD40EZRX Caviar Green 4TB (optional)