Skip to content

Instantly share code, notes, and snippets.

@jcesarmobile
jcesarmobile / notify.js
Last active March 28, 2017 02:53
notify.js del tutorial para enviar notificaciones push desde node.js
var gcm = require('node-gcm');
var sender = new gcm.Sender('AIzaSyCdkyeCkVWgsV1RiWOzfWQ_1WW2m8pWfow');//API key de la parte 1 del tutorial
var registrationIds = [];
var message = new gcm.Message();
message.addData('message',"\u270C Peace, Love \u2764 and PhoneGap \u2706!");
message.addData('title','Push Notification Sample' );
message.addData('msgcnt','3'); // Se muestra en la notificación en la barra de tareas.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<title>Tutorial Push</title>
<script>
document.addEventListener("deviceready", deviceReady, false);
function deviceReady() {
var push = PushNotification.init({
android: {
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, viewport-fit=cover">
<title>statusbar test</title>
</head>
<body style="height:100%;margin:0px;padding:0px;width:100%;">
<div style="background-color:red;height:45px;position:absolute;top:0">AAA</div>
<div style="background-color:red;height:45px;position:absolute;top:0;right:0;">BBB</div>
<div class="app" style="margin:80px">
@implementation UIStatusBarManager (CAPHandleTapAction)
-(void)handleTapAction:(id)arg1 {
NSLog(@"handle tap");
}
@end
@jcesarmobile
jcesarmobile / spawbug.js
Created April 20, 2022 11:44
Spawn closing with -2 on nodejs installed from homebrew
const { spawn } = require('child_process');
const child = spawn('./gradlew', [], { cwd: './android' });
child.stdout.on('data', data => {
console.log(`stdout:\n${data}`);
});
child.stderr.on('data', data => {
console.error(`stderr: ${data}`);