Skip to content

Instantly share code, notes, and snippets.

View dral3x's full-sized avatar

Alessandro Calzavara dral3x

View GitHub Profile
@dral3x
dral3x / View+FrameGeometry.swift
Created November 12, 2023 09:07
Debug SwiftUI view frames
import SwiftUI
extension View {
func frameGeometry(_ color: Color = .red) -> some View {
modifier(FrameGeometry(color: color))
}
}
private struct FrameGeometry: ViewModifier {
let color: Color

Keybase proof

I hereby claim:

  • I am dral3x on github.
  • I am dral3x (https://keybase.io/dral3x) on keybase.
  • I have a public key ASCpu5Ij6vn0s9B3cEZJWmGH2kS_HIxJkG0JKkMrKE0UDAo

To claim this, I am signing this object:

@dral3x
dral3x / dev-scripts.sh
Last active August 28, 2018 07:55 — forked from shaps80/dev-scripts.sh
Open workspace or project from current directory with Xcode, AppCode or Android Studio app. Script will looks for workspaces first, than fallback to project files (when appropriate). Subdirectories are ignored.
#!/usr/bin/env bash
# Published on https://gist.github.com/dral3x/1bbcedaa871fcd04f303
## Common
function __openFileWithApp()
{
if [[ -z "$1" || "$#" -ne 2 ]]; then
echo -e "Nothing found\n"
@dral3x
dral3x / gist:5495295
Last active November 16, 2017 01:25
Script for compiling FFMpeg for Android projects on Mac OS. Please adjust NDK, PLATFORM and PREBUILD variable before run it
#!/bin/bash
######################################################
# Usage:
# put this script in top of FFmpeg source tree
# ./build_android
#
# It generates binary for following architectures:
# ARMv6
# ARMv6+VFP
# ARMv7+VFPv3-d16 (Tegra2)
import UIKit
var output = [String: Any]()
for index in 0..<5 {
let mail = String(format: "%d@mail.com", index)
let name = String(format: "name_%d", index)
let id = NSNumber.init(value: index)
let item: [String: Any] = ["name": name, "id": id]
03-08 15:47:56.790 11356-11356 I/art: Late-enabling -Xcheck:jni
03-08 15:47:56.915 11356-11356 I/InstantRun: Instant Run Runtime started. Android package is com.spreaker.android.radio, real application class is com.spreaker.android.radio.Application.
03-08 15:48:04.399 11356-11356 W/art: Failed to find OatDexFile for DexFile /data/data/com.spreaker.android.radio/files/instant-run/dex/slice-slice_9-classes.dex ( canonical path /data/data/com.spreaker.android.radio/files/instant-run/dex/slice-slice_9-classes.dex) with checksum 0xf0498510 in OatFile /data/data/com.spreaker.android.radio/cache/slice-slice_9-classes.dex
03-08 15:48:05.170 11356-11356 W/art: Failed to find OatDexFile for DexFile /data/data/com.spreaker.android.radio/files/instant-run/dex/slice-slice_8-classes.dex ( canonical path /data/data/com.spreaker.android.radio/files/instant-run/dex/slice-slice_8-classes.dex) with checksum 0x61556ef3 in OatFile /data/data/com.spreaker.android.radio/cache/slice-slice_8-classes.dex
03-08 15:48:12.558 11356-1135
Verifying that +dral3x is my blockchain ID. https://onename.com/dral3x
@dral3x
dral3x / 0-Normal.md
Last active September 1, 2015 12:20
Android M-Preview 3: Table of permissions with group and protection level. More info at http://developer.android.com/preview/features/runtime-permissions.html
Permission Group
android.permission.USE_FINGERPRINT android.permission-group.SENSORS
android.permission.READ_PROFILE null
android.permission.WRITE_PROFILE null
android.permission.READ_SOCIAL_STREAM null
android.permission.WRITE_SOCIAL_STREAM null
android.permission.READ_USER_DICTIONARY null
android.permission.WRITE_USER_DICTIONARY null
com.android.alarm.permission.SET_ALARM null
@dral3x
dral3x / xcode_ramdisk.sh
Last active August 29, 2015 14:18 — forked from skeeet/xcode_ramdisk.sh
Move some Xcode default folder to RAM in order to improve building performances. BE AWARE: moving temp dir to ramdisk could cose issues with other applications/scripts.
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
@dral3x
dral3x / SPKPageViewController.h
Created January 24, 2015 09:23
Subclass of UIPageViewController that fix the Alzheimer bug
#import <UIKit/UIKit.h>
@interface SPKPageViewController : UIPageViewController
@end