Skip to content

Instantly share code, notes, and snippets.

View ikishanoza's full-sized avatar
🎯
Focusing

kishan Oza ikishanoza

🎯
Focusing
View GitHub Profile
_httpGetMessages() {
this.http.get(this.base_url + 'messages').subscribe( (response: any) => {
console.log('_httpGetMessages', response);
let value: any = {};
response.forEach(element => {
console.log(element);
value._id = element.slug;
this._db_messages.get(value._id, (err, doc) => {
if (err) {
@ikishanoza
ikishanoza / fcm-node.js
Created March 27, 2019 10:28
fcm for nodejs
var request = require('request');
function sendMessageToUser(deviceId, message) {
request({
url: 'https://fcm.googleapis.com/fcm/send',
method: 'POST',
headers: {
'Content-Type' :' application/json',
'Authorization': 'key=AI...8o'
},
@ikishanoza
ikishanoza / Angular2 Preload Image
Created February 27, 2019 10:19 — forked from seveves/Angular2 Preload Image
Angular2 Show placeholder base64 image source till image is fully loaded
This component shows a smaller image or a base64 encoded image till the bigger version is fully loaded.
Added a blur/fade effect for the transition.
@ikishanoza
ikishanoza / app.module.ts
Created January 30, 2019 08:08 — forked from pniel-cohen/app.module.ts
Dynamically set page title based on active route in Angular 4
import ...
@NgModule({
...
providers: [ TitleService ],
})
export class AppModule {
constructor(titleService: TitleService) {
titleService.init();
}
<?php
class PushNotification {
// function to send push notification
function push_notification($user_device_tokens, $push_message, $title = "Demo Adventure") {
$api_key_access = '********************'; // API KEY for push notification
$headers = array('Authorization: key=' . $api_key_access, 'Content-Type: application/json');
$msg = array(
"title" => "Notification title",
"body" => "Notification body",
"sound" => "default",
@ikishanoza
ikishanoza / web_service.php
Created October 29, 2018 11:27
Simple login, Signup and Image upload using PHP
<?php
header("Accept: application/json");
header("Content-Type: application/json");
define('LOGIN_SUCCESS_MESSAGE', 'You are successfully login');
define('LOGIN_FAIL_MESSAGE', 'Invalid email or password');
define('SIGNUP_SUCCESS_MESSAGE', 'Signup successfull please login with email and password');
define('SIGNUP_FAIL_MESSAGE', 'Signup fails');
define('MAIL_SEND_SUCCESS', 'Mail send successfully.');
@ikishanoza
ikishanoza / Ionic Setup - Required Commands
Created October 8, 2018 06:19 — forked from vijaydeepak-tt/Ionic Setup - Required Commands
A basic required commands used in the ionic application.
install ionic cordova -g ---> Installing ionic cli in global
ionic start <projectname> <templatename> ---> To create the ionic project
ionic serve - to run the application in the browser.
ionic lab - to run the application in browser window with 3 platform screens.
ionic cordova platform add android or ios ---> to setup the platform
ionic cordova resources ---> creates the icon and splash images of different sizes of our images and splash paste in the resources folder.
ionic cordova run android ---> to run the application on the Androis SDK device.
ionic cordova run android -l ---> this cmd enables the live reload of the application.
ionic generate component, directive, page, pipe, provider, tabs ---> used to generate any of the mention, use only one at a time.
ionic plugin add <pluginname> - used to add any plugins in the project.
@ikishanoza
ikishanoza / fcm-node.js
Last active October 4, 2018 11:38
NodeJs script for Sending push notification using fcm
/*
* NodeJs script for Sending push notification using fcm
*/
// Note : you must be install fcm-node by using command `npm install fcm-node` and then run the script using `node fcm-node.js`
const FCM = require('fcm-node');
// Replace these with your own values.
const apiKey = 'api-key-here';
const deviceID = 'device-token-here';
const fcm = new FCM(apiKey);