Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
// source: | |
// https://stackoverflow.com/questions/24750186/i-cant-get-properties-of-a-class-using-swift-by-class-copypropertylist | |
import Foundation | |
extension NSObject { | |
func dictionaryRepresentation() -> [String: Any] { |
#!/usr/bin/env bash -e | |
## | |
## Automatic version from package.json file | |
## | |
## Call this script from your XCode Scheme: | |
## - Copy / paste this script in a .sh file | |
## - Open your app scheme in XCode (shortcut: Cmd + <) | |
## - go to Build > Pre-actions | |
## - Add a run Script ('+' button in scheme window > "New Run Script Action" |
#!/usr/bin/env zsh | |
sudo rm -f /usr/bin/node | |
sudo rm -f /usr/bin/npm | |
sudo ln -s $(which node) /usr/bin/ | |
sudo ln -s $(which npm) /usr/bin/ |
import React, { useEffect, useRef, useState } from 'react'; | |
import { StyleSheet } from 'react-native'; | |
import AsyncStorage from '@react-native-async-storage/async-storage'; | |
import { SafeAreaView } from 'react-native-safe-area-context'; | |
import WebView, { WebViewMessageEvent } from 'react-native-webview'; | |
import { StatusBar } from 'expo-status-bar'; | |
enum MessageTypes { |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
public static class ExampleViewHolder extends RecyclerView.ViewHolder | |
implements View.OnClickListener { | |
private int originalHeight = 0; | |
private boolean isViewExpanded = false; | |
private YourCustomView yourCustomView | |
public ExampleViewHolder(View v) { | |
super(v); | |
v.setOnClickListener(this); |
# http://codepen.io/morewry/pen/pvLxPV | |
# manually create touch event | |
touchStartOn = (el, x = 0, y = 0) -> | |
try | |
e = document.createEvent('TouchEvent') | |
e.initTouchEvent("touchstart", true, true) | |
catch err | |
try | |
e = document.createEvent('UIEvent') |
function b64EncodeUnicode(str) { | |
return btoa( unescape( encodeURIComponent( str ) ) ); | |
} | |
function b64DecodeUnicode(str) { | |
return decodeURIComponent( escape( atob( str ) ) ); | |
} |