Skip to content

Instantly share code, notes, and snippets.

View MoNTE48's full-sized avatar
🇺🇦
Історія циклічна, але ми так і не навчилися робити висновки…

Maksym H. MoNTE48

🇺🇦
Історія циклічна, але ми так і не навчилися робити висновки…
View GitHub Profile
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active July 22, 2024 12:48
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@snikch
snikch / gist:3661188
Created September 6, 2012 23:16
Find the current top view controller for your iOS application
- (UIViewController *)topViewController{
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController];
}
- (UIViewController *)topViewController:(UIViewController *)rootViewController
{
if (rootViewController.presentedViewController == nil) {
return rootViewController;
}
@granoeste
granoeste / EachDirectoryPath.md
Last active July 23, 2024 09:11
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@osdouglas
osdouglas / sha1.m
Created October 20, 2014 16:28
SHA1 in ObjC
#include <CommonCrypto/CommonDigest.h>
unsigned char digest[CC_SHA1_DIGEST_LENGTH];
NSData *stringBytes = [someString dataUsingEncoding: NSUTF8StringEncoding]; /* or some other encoding */
if (CC_SHA1([stringBytes bytes], [stringBytes length], digest)) {
/* SHA-1 hash has been calculated and stored in 'digest'. */
...
}
@vgezer
vgezer / README.md
Last active November 29, 2021 14:43

Preparing BerryBoot Images

What is BerryBoot?

For people short on SD cards: Berryboot is a simple boot selection screen, allowing you to put multiple Linux distribution on a single SD card. In addition it allows you to put the operating system files on an external USB hard drive instead of on the SD card itself.

Website

@lopspower
lopspower / README.md
Last active July 23, 2024 13:00
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@bagder
bagder / tinycurl.sh
Last active July 12, 2024 12:51
build a tiny curl (on Linux)
#!/bin/sh
export CFLAGS="-Os -ffunction-sections -fdata-sections -fno-unwind-tables -fno-asynchronous-unwind-tables -flto"
export LDFLAGS="-Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections"
./configure \
--disable-cookies \
--disable-crypto-auth \
--disable-dict \
--disable-file \
--disable-ftp \
--disable-gopher \
@santaklouse
santaklouse / CrossOver.sh
Last active July 22, 2024 18:13
unlimited CrossOver trial (MacOS)
#!/usr/bin/env bash
# checck if pidof exists
PIDOF="$(which pidof)"
# and if not - install it
(test "${PIDOF}" && test -f "${PIDOF}") || brew install pidof
# find app in default paths
CO_PWD=~/Applications/CrossOver.app/Contents/MacOS
test -d "${CO_PWD}" || CO_PWD=/Applications/CrossOver.app/Contents/MacOS

How to install game-porting-toolkit (aka proton for macOS)

You also might wanna just use Whisky which does this automatically

This guide works on macOS 13.4+ using Command Line Tools for XCode 15 Beta!

What is this?

In the recent WWDC, Apple announced and released the "game porting toolkit", which upon further inspection this is just a modified version of CrossOver's fork of wine which is a "compatibility layer" that allows you to run Windows applications on macOS and Linux.