Skip to content

Instantly share code, notes, and snippets.

View maximkhatskevich's full-sized avatar

Maxim Khatskevich maximkhatskevich

View GitHub Profile
@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active April 24, 2025 07:41
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@atdrendel
atdrendel / debug.xcconfig
Last active May 11, 2023 11:50
Xcode configuration for iOS, macOS, watchOS, and tvOS framework
// -*- SHARED -*-
SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator
COMBINE_HIDPI_IMAGES = YES
INSTALL_PATH = $(LOCAL_LIBRARY_DIR)/Frameworks
SKIP_INSTALL = YES
COPY_PHASE_STRIP = NO
IPHONEOS_DEPLOYMENT_TARGET = 14.0
MACOSX_DEPLOYMENT_TARGET = 10.15
TVOS_DEPLOYMENT_TARGET = 14.0
@hannesoid
hannesoid / Swift4JSONValue.swift
Created June 26, 2017 13:47
Decodes an unknown JSON structure using Swift 4 Decoding
import XCTest
// Requires a recent Swift 4 snapshot toolchain (Xcode 9 beta 2 not new enough)
public indirect enum JSONValue: Decodable {
case double(Double)
case string(String)
case bool(Bool)
case dictionary([String: JSONValue])
case array([JSONValue])
@brennanMKE
brennanMKE / directoryExistsAtPath.swift
Created April 20, 2017 22:23
Directory Exists at Path in Swift
fileprivate func directoryExistsAtPath(_ path: String) -> Bool {
var isDirectory = ObjCBool(true)
let exists = FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory)
return exists && isDirectory.boolValue
}
@kharrison
kharrison / CoreDataController.swift
Last active January 31, 2023 22:36
Swift wrapper for NSPersistentContainer - Easy Core Data Setup with iOS 10
//
// CoreDataController.swift
//
// Created by Keith Harrison http://useyourloaf.com
// Copyright (c) 2017 Keith Harrison. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 27, 2025 06:17
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@chriseidhof
chriseidhof / json.swift
Last active March 21, 2019 07:45
Reflection
import Cocoa
struct Person {
var name: String = "John"
var age: Int = 50
var dutch: Bool = false
var address: Address? = Address(street: "Market St.")
}
struct Address {
@kristopherjohnson
kristopherjohnson / firstDifferenceBetweenStrings.swift
Last active July 19, 2024 19:08
Swift code to find differences between strings and display them in a readable way, useful for displaying unit test results
import Foundation
/// Find first differing character between two strings
///
/// :param: s1 First String
/// :param: s2 Second String
///
/// :returns: .DifferenceAtIndex(i) or .NoDifference
public func firstDifferenceBetweenStrings(s1: NSString, s2: NSString) -> FirstDifferenceResult {
@zenorocha
zenorocha / .hyper.js
Last active April 11, 2025 07:01 — forked from millermedeiros/osx_setup.md
Setup macOS Sierra (10.12)
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
@bryanjclark
bryanjclark / Given an NSRange and a UILabel with attributed text, find the CGRect of a substring
Last active July 15, 2021 10:42
My three current contenders for solving a tricky UILabel question: given an NSRange and a UILabel that displays attributed text, can you find the rect of the text in that range? Link to my related Stack Overflow question: http://stackoverflow.com/questions/19417776/how-do-i-locate-the-cgrect-for-a-substring-of-text-in-a-uilabel
- (CGRect)rectForSubstringWithRange:(NSRange)range
{
/* Core Text methods that seem somewhere in the neighborhood of useful:
CTRunGetPositionsPtr
CTRunGetPositions
CTRunGetImageBounds
CTLineGetStringRange
CTLineGetOffsetForStringIndex
CTLineGetImageBounds