Skip to content

Instantly share code, notes, and snippets.

@binand
binand / Apple_mobile_device_types.txt
Created February 22, 2022 07:22 — 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
@binand
binand / CIEditorScript.cs
Created March 7, 2019 11:15 — forked from alexsorokoletov/CIEditorScript.cs
Unity3d automation script for Android and iOS
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class CIEditorScript
{
static string[] SCENES = FindEnabledEditorScenes ();
@binand
binand / StateSavingArrayAdapter.java
Created December 4, 2016 05:49 — forked from curioustechizen/StateSavingArrayAdapter.java
StateSavingArrayAdapter: An ArrayAdapter that knows how to save/restore its own state.
/**
* <p>
* An {@code ArrayAdapter} that also knows how to save and restore its state.
* Basically all it does is save/restore the array of objects being managed by
* the Adapter.
* </p>
*
* <p>
* Note that this only saves the items and not things like checked item
* positions. Those belong to the {@link ListView} itself. Consider using
@binand
binand / countermanager.sh
Created October 23, 2016 15:01
A small shell library for manipulating a counter in shell scripts
#!/bin/bash
# Initializes the counter to 0 (uses filename in arg #1 for state). Returns 0 on success.
function init_counter() {
local _f=$1
if [ ! -f $_f ]; then
local _t=$( mktemp $( dirname $_f )/b.XXXXXXXX )
echo 0 > $_t
mv -f $_t $_f
fi
@binand
binand / largest.c
Created October 17, 2016 03:02
Locates the largest file (files) in a directory and its subdirectories passed as argument.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ftw.h>
struct currentry {
char **path;
int cnt;
size_t size;
};