Skip to content

Instantly share code, notes, and snippets.

:octocat:
I may be slow to respond.

Alexander Belyavskiy diejmon

:octocat:
I may be slow to respond.
Block or report user

Report or block diejmon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@diejmon
diejmon / lldb-debugging.md
Created Dec 23, 2018 — forked from alanzeino/lldb-debugging.md
LLDB debugging with examples
View lldb-debugging.md

LLDB Debugging Cheat Sheet

Commands

LLDB Commands

LLDB comes with a great set of commands for powerful debugging.

help

Your starting point for anything. Type help to get a list of all commands, plus any user installed ones. Type 'help <command-name> for more information on a command. Type help <command-name> <option> to get help for a specific option in a command too.

View swift_compiler_crash.swift
import Foundation
extension URLComponents {
public mutating func whyThisFails() {
guard let currentComponentString = components.string,
let components = URLComponents(string: currentComponentString) else { return }
self = components
}
View ObjectObserver.swift
import Foundation
public final class ObjectObserver<Object: NSObject>: NSObject {
private var observationContext = 0
// MARK: - Init
public typealias KeyPath = String
private let observers: [KeyPath: (KeyPath, Object) -> Void]
View debug_swift_compilation_time.xcconfig
OTHER_SWIFT_FLAGS= $(inherited) -Xfrontend -warn-long-function-bodies=120 -Xfrontend -debug-time-expression-type-checking -Xfrontend -debug-time-function-bodies
View Tools.md
View update_git_author.sh
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="OLD_EMAIL"
CORRECT_NAME="CORRECT_NAME"
CORRECT_EMAIL="CORRECT_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
View Permute array.c
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
void permute(int *, int, int);
View keybase.md

Keybase proof

I hereby claim:

  • I am diejmon on github.
  • I am diejmon (https://keybase.io/diejmon) on keybase.
  • I have a public key whose fingerprint is A156 CF5E 7882 F3B4 C6C6 F3FA 5DF1 D8F3 E236 6ACC

To claim this, I am signing this object:

@diejmon
diejmon / BuildWorksheet.scpt
Created May 16, 2016
BillingTimer build worksheet from timers
View BuildWorksheet.scpt
function buildWorkLog(timers) {
var worklog = ''
for (t in timers) {
worklog += timers[t].pause_date() + ': ' + timers[t].name() + ' ' + timers[t].formatted_time() + '\n'
}
return worklog
}
function saveWorkLog(worklog) {
finder = Application("Finder")
View Check if MacBook LID closed.m
bool isLidClosed(void)
{
bool isClosed = false;
io_registry_entry_t rootDomain;
mach_port_t masterPort;
CFTypeRef clamShellStateRef = NULL;
// Retrieve the IOKit's master port so a notification port can be created
IOReturn ioReturn = IOMasterPort(MACH_PORT_NULL, &masterPort);
You can’t perform that action at this time.