Skip to content

Instantly share code, notes, and snippets.

@shamilovtim
shamilovtim / applesimutils_list.json
Created January 24, 2022 22:06
applesimutils --list
[
{
"os" : {
"bundlePath" : "\/Applications\/Xcode-13.2.1.app\/Contents\/Developer\/Platforms\/AppleTVOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/tvOS.simruntime",
"buildversion" : "19K50",
"runtimeRoot" : "\/Applications\/Xcode-13.2.1.app\/Contents\/Developer\/Platforms\/AppleTVOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/tvOS.simruntime\/Contents\/Resources\/RuntimeRoot",
"identifier" : "com.apple.CoreSimulator.SimRuntime.tvOS-15-2",
"version" : "15.2",
"isAvailable" : true,
"supportedDeviceTypes" : [
@shamilovtim
shamilovtim / sudo_applesimutils_list.json
Last active January 24, 2022 22:03
sudo applesimutils --list
[
{
"os" : {
"bundlePath" : "\/Applications\/Xcode-13.2.1.app\/Contents\/Developer\/Platforms\/AppleTVOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/tvOS.simruntime",
"buildversion" : "19K50",
"runtimeRoot" : "\/Applications\/Xcode-13.2.1.app\/Contents\/Developer\/Platforms\/AppleTVOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/tvOS.simruntime\/Contents\/Resources\/RuntimeRoot",
"identifier" : "com.apple.CoreSimulator.SimRuntime.tvOS-15-2",
"version" : "15.2",
"isAvailable" : true,
"supportedDeviceTypes" : [
import { useState, useEffect } from 'react';
import { AppState } from 'react-native';
export default function useAppState(settings) {
const { onChange, onForeground, onBackground } = settings || {};
const [appState, setAppState] = useState(AppState.currentState);
useEffect(() => {
function handleAppStateChange(nextAppState) {
if (nextAppState === 'active' && appState !== 'active') {
@shamilovtim
shamilovtim / RNfontWeights.js
Created June 18, 2019 21:08 — forked from knowbody/RNfontWeights.js
React Native Font Weight Cheatsheet iOS
{ fontWeight: '100' }, // Thin
{ fontWeight: '200' }, // Ultra Light
{ fontWeight: '300' }, // Light
{ fontWeight: '400' }, // Regular
{ fontWeight: '500' }, // Medium
{ fontWeight: '600' }, // Semibold
{ fontWeight: '700' }, // Bold
{ fontWeight: '800' }, // Heavy
{ fontWeight: '900' }, // Black
@shamilovtim
shamilovtim / XSLT Variable Test
Last active December 19, 2015 19:58
Test if XSLT variable has value
<xsl:choose>
<xsl:when test="not($pasts)"> <p> no exist </p>
</xsl:when>
<xsl:otherwise> <p>exists</p></xsl:otherwise>
</xsl:choose>
@shamilovtim
shamilovtim / jQuery Fastest First Child
Created May 22, 2013 19:57
jQuery fastest way of selecting first child
$($('#test')[0].firstChild);
<script src=" https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>