Skip to content

Instantly share code, notes, and snippets.

View xavetar's full-sized avatar
:electron:

Stanislav Mikhailov xavetar

:electron:
  • Xavetar Inc.
  • Milky Way
View GitHub Profile
@kenji21
kenji21 / xcode-previous-older-sdks.md
Last active December 6, 2025 00:18
Use previous/older SDKs with Xcode
@andsve
andsve / app_delegate.c
Created January 17, 2019 13:36
A simple implementation of a NSApplicationDelegate and two methods (openFile:, openFiles:) in pure C.
/*
app_delegate.c
1. Compile and link with:
$ clang -g -o AppInC app_delegate.c -lobjc -framework Foundation -framework AppKit -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
2. Create a Info.plist with:
[[
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@lpranam
lpranam / squash.md
Last active August 3, 2025 10:49
How to squash commits

What is squashing?

Squashing is a process in which we squeeze multiple commits into one pretending it is only a single commit.

Basically squashing commits means we are rewriting the history of commits to make them look like single commit.

squash-diagram.jpg

Why squashing commits is necessary?

@AkdM
AkdM / Edit_Repack_ISO_tutorial.md
Last active November 10, 2025 13:38
Edit and repack .iso bootable image

On Linux

Installing mkisofs

apt-get install mkisofs

Editing ISO image

mkdir /tmp/custom_iso

@vitorio
vitorio / osx-rpiboot-homedir.md
Last active January 4, 2023 19:10
Compiling libusb and rpiboot natively on OS X within your home directory

NOTE: rpiboot doesn't actually work on recent OS X versions and/or Macs due to a bug in the RPi0/RPi1 chipset: https://www.raspberrypi.org/forums/viewtopic.php?f=98&t=90825

These instructions compile a native OS X version of rpiboot that lives in your home directory, and which cannot be moved around, but should always be discoverable by applications.

Assumes OS X with Xcode or Xcode command-line tools, not macports or homebrew

To install Xcode command-line tools in recent versions of OS X, open Terminal, type xcode-select --install and click "Install"

Older versions of OS X may need to manually download disk images of older versions of Xcode and/or the Xcode command-line tools, as various certificates may have expired (e.g. 10.7.4 requires a manual install from the Xcode 4.6.2 command-line tools image)

@DonnchaC
DonnchaC / torrent-file-size.py
Last active December 8, 2024 11:04
Get total file sizes of contents for a set of .torrent files
import os
import sys
import bencodepy
import humanize
import argparse
def total_size_files_torrent(file_name):
try:
parsed = bencodepy.decode_from_file(file_name)
@tpai
tpai / instructions.md
Last active December 19, 2024 06:55
use both Tor and Privoxy on Mac OS

1. install

brew install tor
brew install privoxy

2. copy and modify config file

@iburlakov
iburlakov / CFDictionaryGetValueIfPresent_Sample.c
Created September 27, 2012 19:18
Using of CFDictionaryGetValueIfPresent
CFDictionaryRef dict;
/*
Get some dictionary...
*/
SInt32 intVal = 0;
CFNumberRef cfIntVal;
char* strVal;
CFStringRef cfStrVal;