Skip to content

Instantly share code, notes, and snippets.

View malayli's full-sized avatar

Digifox (Malik Alayli) malayli

  • Digital Fox
  • Tokyo, Japan
View GitHub Profile
u32 vscroll;
...
void myHBlankFunction()
{
// modify V scroll value
VDP_setVerticalScroll(APLAN, 0, vscroll >> 8);
vscroll += 0x30;
}
...
git ls-files | xargs wc -l
@malayli
malayli / Apple_mobile_device_types.txt
Created April 27, 2021 07:04 — forked from adamawolf/Apple_mobile_device_types.txt
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
## Create general_pod_info.plist at the root folder:
<?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">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
$0000-$3FFF (32K): 1024 tiles for BG1 and BG2
$4000-$5FFF (16K): 512 sprite tiles
$6000-$67FF (4K): BG1 map
$6800-$6FFF (4K): BG2 map
$7000-$77FF (4K): BG3 map
$6000-$7FFF ($7800-$7FFF used): 256 HUD tiles for BG3
// Dependencies Container Example
class UserViewModel {
func name() -> String {
"John"
}
}
struct PremiumViewModel {
func rights() -> String {
@malayli
malayli / UIViewControllerPreview.swift
Created January 28, 2020 15:15 — forked from mattt/UIViewControllerPreview.swift
Generic structures to host previews of UIView and UIViewController subclasses.
import UIKit
#if canImport(SwiftUI) && DEBUG
import SwiftUI
struct UIViewControllerPreview<ViewController: UIViewController>: UIViewControllerRepresentable {
let viewController: ViewController
init(_ builder: @escaping () -> ViewController) {
viewController = builder()
}
@malayli
malayli / gist:017665f8b4b258457c1d087995bc5a54
Created November 8, 2019 06:42 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
//Good morning! Here's your coding interview problem for today.
//
//This problem was asked by Google.
//
//Given the root to a binary tree, implement serialize(root), which serializes the tree into a string, and deserialize(s), which deserializes the string back into the tree.
//
//For example, given the following Node class
//
//class Node:
// def __init__(self, val, left=None, right=None):
// Binary Tree
class TreeNode {
let value: Int
var parent: TreeNode?
var left: TreeNode?
var right: TreeNode?
init(value: Int, parent: TreeNode?, left: TreeNode?, right: TreeNode?) {
self.value = value