Skip to content

Instantly share code, notes, and snippets.

View xhruso00's full-sized avatar

Marek Hrusovsky xhruso00

  • Bratislava, Slovakia
View GitHub Profile
@xhruso00
xhruso00 / osx.sh
Created July 23, 2014 15:49 — forked from edsonaj/osx.sh
#!/bin/bash
# Based on https://github.com/mathiasbynens/dotfiles/blob/master/.osx
###############################################################################
# General UI/UX #
###############################################################################
# Set computer name (as done via System Preferences → Sharing)
scutil --set ComputerName "Edson Alves Junior's MacBook Pro"
scutil --set HostName "Edson Alves Junior's MacBook Pro"
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
//
// main.m
// antidebugging
//
// Created by Vincent Tan on 7/8/15.
// Copyright (c) 2015 Vincent Tan. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
@xhruso00
xhruso00 / gist:cf8243b552be4fb5372c857e602f6859
Created October 9, 2017 16:08 — forked from lukhnos/gist:2892699
Enumerate all available keyboard layouts on Mac OS X and write out their icons
// need to include <Carbon/Carbon.h> and link against Carbon.framework
// not every layout/input method has TIFF icon
CFArrayRef list = TISCreateInputSourceList(NULL, true);
for (int i = 0; i < CFArrayGetCount(list); i++) {
TISInputSourceRef source = (TISInputSourceRef)CFArrayGetValueAtIndex(list, i);
IconRef icon = TISGetInputSourceProperty(source, kTISPropertyIconRef);
CFStringRef sourceID = TISGetInputSourceProperty(source, kTISPropertyInputSourceID);
@xhruso00
xhruso00 / Mojave-dynamic-wallpaper-notes.md
Created June 14, 2018 02:29 — forked from ole/Mojave-dynamic-wallpaper-notes.md
Reverse-engineering the dynamic wallpaper file format in macOS Mojave.

The dynamic wallpaper in MacOS Mojave is a single 114 MB .heic file that seems to contain 16 embedded images.

It also contains the following binary plist data in its metadata under the key "Solar". It's an array of 16 items, each with four keys:

  • i (integer). This seems to be the image index.
  • o (integer). This is always 1 or 0. Stephen Radford thinks it indicates dark mode (0) vs. light mode (1).
  • a (decimal). I’m pretty sure this is the angle of the sun over the horizon. 0º = sunset/sunrise. 90º = sun directly overhead. Negative values = sun below horizon.
  • z (decimal). This seems to be the cardinal position of the sun relative to the camera. 0º = sun is directly in front of the camera. 90º = sun is directly to the right of the camera. 180º = sun is directly behind the camera.
@xhruso00
xhruso00 / README.md
Created June 13, 2022 02:49 — forked from IsaacXen/README.md
(Almost) Every WWDC videos download links for aria2c.