Skip to content

Instantly share code, notes, and snippets.

View csantanapr's full-sized avatar
🏠
Working from home

Carlos Santana csantanapr

🏠
Working from home
View GitHub Profile
@csantanapr
csantanapr / IBMDataHybrid.js
Created August 13, 2014 04:02
IBMDataHybrid.js
cordova.define("com.ibm.mobile.cordova.ibmdata.hybrid", function(require, exports, module) { /*!
* Licensed Materials - Property of IBM
* 5725-I43 (C) Copyright IBM Corp. 2011, 2014. All Rights Reserved.
* US Government Users Restricted Rights - Use, duplication or
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*
* IBM Mobile Cloud Services,
* IBMData Service JavaScript SDK v1.0.0.20140807-1234
*
*/
@csantanapr
csantanapr / index.js
Last active August 29, 2015 14:05
BluemixDataCordovaTest.js
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@csantanapr
csantanapr / main.js
Created February 21, 2015 20:59
MFP JSONStore sample
function wlCommonInit(){
/*
* Use of WL.Client.connect() API before any connectivity to a MobileFirst Server is required.
* This API should be called only once, before any other WL.Client methods that communicate with the MobileFirst Server.
* Don't forget to specify and implement onSuccess and onFailure callback functions for WL.Client.connect(), e.g:
*
* WL.Client.connect({
* onSuccess: onConnectSuccess,
* onFailure: onConnectFailure
* });

Chrome on OSX

  • sans-serif 100 = Helvetica Light
  • sans-serif 200 = Helvetica Light
  • sans-serif 300 = Helvetica Light
  • sans-serif 400 = Helvetica Regular
  • sans-serif 500 = Helvetica Regular
  • sans-serif 600 = Helvetica Bold
  • sans-serif 700 = Helvetica Bold
@csantanapr
csantanapr / run_ionic_app_on_all_connected_android_devices.sh
Last active April 24, 2018 08:42 — forked from boyney123/run_ionic_app_on_all_connected_android_devices.sh
Simple bash script to remove, build, install and launch your ionic app on all connected android devices (android simulators or actual devices).
#!/bin/sh
#Your app id which can be found in your config.xml file (widget id)
app=com.ionicframework.myNewApp
pathToAPK=platforms/android/build/outputs/apk/android-debug.apk
echo "Running Ionic Build"
ionic build
@csantanapr
csantanapr / cordova-tips.md
Last active August 29, 2015 14:27 — forked from revolunet/cordova-tips.md
Cordova iOS tips

General

  • create a single page javascript application
  • be as low-level as possible to be able to control performance (=minimize layers)
  • masterize your dev/build environnement so you can work/play nicely

Debug apps

@csantanapr
csantanapr / install_nodeschool.sh
Last active August 29, 2015 11:03
Interesting Packages for node school workshop http://nodeschool.io/#workshopper-list
#!/bin/bash
#get debugging tools
npm -i -g node-inspector
#core
npm i -g javascripting git-it scope-chains-closures learnyounode how-to-npm stream-adventure
#electives
npm i -g functional-javascript-workshop levelmeup expressworks makemehapi promise-it-wont-hurt async-you planetproto esnext-generation test-anything tower-of-babel regex-adventure bytewise bug-clinic browserify-adventure count-to-6 kick-off-koa lolodash learn-generators learnyoureact perfschool
- (void)applicationWillResignActive:(UIApplication *)application
{
self.window.hidden = YES;
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
self.window.hidden = NO;
}
@csantanapr
csantanapr / server.js
Created September 7, 2015 15:43
setup express with cors for ionic or cordova
var express = require('express');
var app = express();
var baseUrl = __dirname + '/www';
app.use(express.static(baseUrl));
var allowCrossDomain = function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
@csantanapr
csantanapr / config.xml
Last active September 21, 2015 20:16
ATS exception
<platform name="ios">
<config-file target="*-Info.plist" parent="NSAppTransportSecurity">
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</config-file>
</platform>