This file contains hidden or 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
// Create cluster.js in application folder, | |
// install "npm i nuxt-start", | |
// before start do "npm run build". | |
// Start this via "node ./cluster.js" | |
const cluster = require('cluster') | |
const os = require('os') | |
const { loadNuxt } = require('nuxt-start') |
This file contains hidden or 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
private val mPicture = Camera.PictureCallback { data, _ -> | |
val myBitmap: Bitmap = BitmapFactory.decodeByteArray(data, 0, data.size) | |
// Rotate image | |
val matrix = Matrix() | |
matrix.postRotate(90f) | |
val rotatedBitmap = Bitmap.createBitmap(myBitmap, 0, 0, myBitmap.width, myBitmap.height, matrix, true) | |
// Ready, but before please init var viewPhoto: ImageView | |
// viewPhoto.setImageBitmap(rotatedBitmap) | |
} |
This file contains hidden or 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
var exec = require('cordova/exec'); | |
exports.start = function (arg0, success, error) { | |
exec(success, error, 'KotlinToast', 'start', [arg0]); | |
}; |
This file contains hidden or 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
<?php | |
/* | |
* Plugin name: Добавление моего JS кода | |
* Description: Я не смог придумать описание для этого плагина | |
* Version: 0.0.1 | |
* Author: Максим Колмогоров | |
* Author URI: https://vk.com/maxim_kolmogorov | |
*/ | |
add_action('admin_head', 'add_my_js_from_plugin'); |
This file contains hidden or 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
<?php | |
$url = "https://fcm.googleapis.com/fcm/send"; | |
$tokens = array('token1', 'token2'); // your devices tokens (limit 500) | |
$serverKey = 'ApiKey'; // Server Api Key from Firebase Console | |
$notification = array( | |
'title' => $title, // message title | |
'body' => $body, // message body | |
'sound' => 'default', // sound | |
); | |
$arrayToSend = array( |
This file contains hidden or 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
<platform name="android"> | |
<preference name="AndroidXEnabled" value="true" /> | |
</platform> |
This file contains hidden or 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
package com.plugin; | |
import org.apache.cordova.CordovaPlugin; | |
import org.apache.cordova.CallbackContext; | |
import org.json.JSONArray; | |
import org.json.JSONObject; | |
import org.json.JSONException; | |
import android.content.Context; | |
import android.widget.Toast; |
This file contains hidden or 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
<?xml version='1.0' encoding='utf-8'?> | |
<plugin id="maxim-kolmogorov-echo-test" version="0.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android"> | |
<name>EchoTest</name> | |
<js-module name="EchoTest" src="www/EchoTest.js"> | |
<clobbers target="echotest" /> | |
</js-module> | |
<platform name="android"> | |
<config-file target="config.xml" parent="/*"> | |
<feature name="EchoTest"> | |
<param name="android-package" value="com.plugin.EchoTest" /> |
This file contains hidden or 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
var app = { | |
initialize: function() { | |
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false); | |
}, | |
onDeviceReady: function() { | |
this.receivedEvent('deviceready'); | |
echotest.echo('YO BRO!', function(msg) { | |
document.getElementById('deviceready').querySelector('.received').innerHTML = msg; |
This file contains hidden or 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
@objc(EchoTest) class EchoTest : CDVPlugin { | |
@objc(echo:) | |
func echo(command: CDVInvokedUrlCommand) { | |
var pluginResult = CDVPluginResult( | |
status: CDVCommandStatus_ERROR | |
) | |
let msg = command.arguments[0] as? String ?? "" | |
if msg.characters.count > 0 { |