View react-native-parse-xml-example.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Before use, type: | |
* ``` | |
* npm install xmldom --save | |
* ``` | |
*/ | |
window.DOMParser = require('xmldom').DOMParser; |
View react-native-ios-splash.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
... | |
... | |
... | |
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation | |
moduleName:@"MyAwesomeApp" | |
initialProperties:@{} | |
launchOptions:launchOptions]; |
View convert.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in *.wav; do ffmpeg -i "$file" -ac 1 -ar 20050 "../WAVout/$file"; done |
View index.ios.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
*/ | |
'use strict'; | |
var React = require('react-native'); | |
var signalr = require('react-native-signalr'); |
View .sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################## | |
# | |
# Calvium Android .gitignore | |
# | |
######################################## | |
# Android NDK | |
**/src/main/obj | |
**/src/main/libs |
View jsonExport.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
// Adapted from http://blog.pamelafox.org/2013/06/exporting-google-spreadsheet-as-json.html | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
View getPackageName.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extract the android package id from a built apk file | |
# usage ./getPackageName.sh <path-to-apk> | |
line=`aapt dump badging "$1" | grep package:\ name` | |
# above returns: | |
# package: name='com.calvium.myapp' versionCode='1' versionName='1.0' | |
if [[ $line =~ name=\'(.+)\'\ versionCode ]]; then | |
echo ${BASH_REMATCH[1]} | |
else | |
echo "Failed to find package name" |
View update-build-number.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# SETUP INSTRUCTIONS | |
#----------------------- | |
# | |
# Add this file to a folder called 'scripts' at the same level as your xcodeproj file | |
# Open XCode | |
# Select Project on left-hand view | |
# TARGETS / your target |
View indexPathAtEndOfScroll.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView | |
withVelocity:(CGPoint)velocity | |
targetContentOffset:(CGPoint *)targetContentOffset { | |
CGPoint point = *targetContentOffset; | |
// Get point in the Center of the view | |
CGPoint centerPoint = CGPointMake(point.x + CGRectGetWidth(scrollView.bounds) / 2, point.y); | |
NSIndexPath *path = [self.collectionView indexPathForItemAtPoint:centerPoint]; |
View generateAppIcon.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# -------------------------------------------------------- | |
# Generate app icons and xcassets file from a single image | |
# Ben Clayton, Calvium Ltd. | |
# -------------------------------------------------------- | |
# To use this, place script in `appname` folder inside your project (i.e. the folder that Xcode generates for you containing your source code, it's named after whatever you called the app). | |
# Create folder there called `RawImages`. | |
# Source icon should 1024x1024 and be called appIcon.png. If the icon changes, you can just run this again to regenerate everything. | |
# This script assumes that you have the default setup of an Images.xcassets file containing the AppIcon.appiconset. |