Skip to content

Instantly share code, notes, and snippets.

View selimanac's full-sized avatar

Selim Anaç selimanac

View GitHub Profile
@selimanac
selimanac / device.lua
Created October 23, 2024 16:02 — forked from aglitchman/device.lua
Detect operating system (iOS, Android, Blackberry, Windows, Firefox OS, MeeGo), orientation (Portrait vs. Landscape), and type (Tablet vs. Mobile). Lua module for the Defold game engine.
-- Based on the device.js module: https://github.com/matthewhudson/current-device
-- MIT License
--
-- Usage:
-- local device = require("device")
-- if device.type == "mobile" then
-- -- do something!
-- end
--
-- Or:
@selimanac
selimanac / Makefile
Created October 13, 2018 15:58 — forked from j0sh/Makefile
iOS static library cross-compile script.
# iOS builds for ARMv7 and simulator i386.
# Assumes any dependencies are in a local folder called libs and
# headers in a local folder called headers.
# Dependencies should already have been compiled for the target arch.
PROJ=untitled
ifeq ($(IOS), 1)
ARCH=armv7
DEVICE=OS
CC_FLAGS=-arch $(ARCH)