Skip to content

Instantly share code, notes, and snippets.

View matteocollina's full-sized avatar

Matteo Collina matteocollina

  • DMA
  • Cesena (FC) - Italy
View GitHub Profile
@matteocollina
matteocollina / Podfile_RN_0_51_0
Created May 8, 2018 15:49
Podfile stable ios React Native 0.51.0
# Podfile stable ios React Native 0.51.0 and React 16.0.0
project 'Golee.xcodeproj'
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Golee' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
@matteocollina
matteocollina / onResume-flux.js
Created July 4, 2018 21:23
onResume React-native-flux
<Lightbox key="lightbox">
<Drawer
hideNavBar
key="drawer"
contentComponent={MenuContent}
drawerImage={MenuIcon}
drawerWidth={300}
initial
>
<Scene key="team_nav">
@matteocollina
matteocollina / mongoutils.sh
Last active June 12, 2018 21:08
Lesson on Mongo db @ University (Milan). From install packages on python, to test Pymongo on macOSX
# ------ Prerequisites ------
# Start server
$ mongod
# Start client
$ mongo
# Install packages on python 2.7 (required version of "pip" >= 10)
$ sudo pip install --ignore-installed pymongo
$ sudo pip install --ignore-installed numpy
# react-native-cli: 2.0.1
# react-native: 0.55.3
# NB: My rn files are inside "js" dir
project 'Golee.xcodeproj'
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
@matteocollina
matteocollina / Fastfile
Last active April 27, 2018 16:44
An example to create ad-hoc ipa and deploy to Crashlytics
platform :ios do
desc "Example Fastlane - Ipa + Crashlytics"
lane :beta do
get_provisioning_profile(
adhoc: true,
force: true
)
gym(
export_method:"ad-hoc",
scheme: "MyApp",
@matteocollina
matteocollina / make_app_simulator.sh
Created April 26, 2018 12:05
Make .app file for simulator
# Replace "MyApp" with your app name
XCODE_WORKSPACE=/Users/MacBook/iOS/MyApp.xcworkspace
xcrun xcodebuild \
-scheme MyApp \
-workspace $XCODE_WORKSPACE \
-configuration Debug \
-destination 'platform=iOS Simulator,name=iPhone 8,OS=11.2' \
-derivedDataPath \
build
@matteocollina
matteocollina / exp-jsbundle.sh
Last active April 4, 2018 14:05
This is the script to export the .jsbundle and import to Main Bundle of the app. It's necessary when you want to deploy an iOS with integrated React Native app on AppStore/TestFlight
# If on Release, must export js bundle to run
if [ "$CONFIGURATION" == "Debug" ]; then
echo "Debug Configuration"
else
echo "Release Configuration"
# in my project "js/node_modules"
cd js
# Create a new .jsbundle
react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output main.jsbundle
@matteocollina
matteocollina / package.json
Created March 29, 2018 21:41
Simple React Native package.json
{
"name": "StoryReact",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
}
}
@matteocollina
matteocollina / Podfile
Created March 29, 2018 21:40
Podfile to install react dependencies
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'StoryReact' do
use_frameworks!
pod 'React', :path => './js/node_modules/react-native', :subspecs => [
'Core',
'CxxBridge',
'DevSupport',
'RCTText',
'RCTNetwork',
@matteocollina
matteocollina / info.plist
Created March 29, 2018 21:38
To enable Transport Security on Xcode project (HTTP requests)
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>