Skip to content

Instantly share code, notes, and snippets.

View ksylvan's full-sized avatar

Kayvan Sylvan ksylvan

View GitHub Profile
@ksylvan
ksylvan / current-date-and-time.applescript
Created October 10, 2023 21:58 — forked from Glutexo/current-date-and-time.applescript
AppleScript to get current date and time (YYYY-MM-DD HH:MM:SS). Usable as a Text Service in Mac OS X.
(*
The zero_pad function taken from:
http://www.nineboxes.net/2009/10/an-applescript-function-to-zero-pad-integers/
*)
on zero_pad(value, string_length)
set string_zeroes to ""
set digits_to_pad to string_length - (length of (value as string))
if digits_to_pad > 0 then
repeat digits_to_pad times
set string_zeroes to string_zeroes & "0" as string
@ksylvan
ksylvan / Join Zoom.scpt
Created October 6, 2023 01:30 — forked from JacksonChen666/Join Zoom.scpt
Join zoom at the speed of computers (AppleScript)
# It is recommended that you save this script as an application, so you don't have to open Script editor.
(*
It all started when I wanted to join zoom faster than a human could do with no prompt like how I expected like this.
I first discovered zoom.us's URL scheme to join meeting, but when I found out it doesn't work, I started to make this program.
After this all of stuff, I finally have something that is constantly updated.
After this pandemic is over, development might slow down or become discontinued.
*)
global meetingNames, meetingIDs, meetingPwds, wname
# Compiling the app will reset all your saved meetings!
property meetingNames : {}
@ksylvan
ksylvan / cuda_check.py
Created April 23, 2023 23:52 — forked from f0k/cuda_check.py
Simple python script to obtain CUDA device information
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Outputs some information on CUDA-enabled devices on your computer,
including current memory usage.
It's a port of https://gist.github.com/f0k/0d6431e3faa60bffc788f8b4daa029b1
from C to Python with ctypes, so it can run without compiling anything. Note
that this is a direct translation with no attempt to make the code Pythonic.
@ksylvan
ksylvan / How-to-Symbolize-MacOSX-Crash-Dump
Created December 9, 2020 16:21 — forked from jerrykrinock/How-to-Symbolize-MacOSX-Crash-Dump
How to symbolize a crash dump in Mac OS X, given a crash dump or exception log. Includes some steps and tips I've collected that are missing in Apple's TN2123. One time I tried this using lldb instead of gdb but it didn't work.
********************************************************
*** STEPS TO SYMBOLIZE A CRASH DUMP OR EXCEPTION LOG ***
********************************************************
1) Move/copy both the crashing .app and the relevant.dSYM files into the same directory.
2) If the crash was in a framework, dynamic library, or bundle, you have position-independent code and must work out the *slide*. Otherwise, skip up to step 9 and use slide=0.
3a) If you have a crash dump, look in the *Binary Images* part of the crash log and find the framework, dynamic libray or bundle in which the crash occurred. Read the first column of the output. This is the address at which the __TEXT segment was loaded. We call it the *Actual Load Address* and denote it as *A*.

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?