Skip to content

Instantly share code, notes, and snippets.

SETUP:
wget -O drive https://drive.google.com/uc?id=0B3X9GlR6EmbnMHBMVWtKaEZXdDg
mv drive /usr/sbin/drive
chmod 755 /usr/sbin/drive
Now, simply run drive to start the authentication process. You'll get a link like this to paste and browse to in to your web browser:
@manniru
manniru / copyFirestoreDB.js
Created September 14, 2019 20:28 — forked from brunobraga95/copyFirestoreDB.js
Copy firestore database
const firebase = require('firebase-admin');
var serviceAccountSource = require("./source.json"); // source DB key
var serviceAccountDestination = require("./destination.json"); // destiny DB key
const sourceAdmin = firebase.initializeApp({
credential: firebase.credential.cert(serviceAccountSource)
});
const destinyAdmin = firebase.initializeApp({
$pic = file_create_url('public://images/1417218384.jpg');
$row['picture'] = [
'data' => [
'#type' => 'html_tag',
'#tag' => 'img',
'#attributes' => ['src' => $pic, 'width' => '70'],
],
];
const cors = require('cors')({origin: true});
exports.remita_rrrstatus = functions.https.onRequest(
async (req, res) => {
res.set('Access-Control-Allow-Origin', "*")
res.set('Access-Control-Allow-Methods', 'GET, POST')
cors(req, res, async () => {
try {
import React, { Fragment, useState, useEffect } from 'react';
import axios from 'axios';
function App() {
const [data, setData] = useState({ hits: [] });
const [query, setQuery] = useState('redux');
const [url, setUrl] = useState(
'https://hn.algolia.com/api/v1/search?query=redux',
);
const [isLoading, setIsLoading] = useState(false);
useEffect(() => {
public function aha_classes() {
$query = \Drupal::database()->select('_class', 'tb');
$query->fields('tb', ['serial','class_name']);
$results = $query->execute()->fetchAll();
$content = [];
$rows = [];
$headers = [
$this->t('ID'),
@manniru
manniru / eschool-sms.js
Created September 11, 2019 15:22
ESCHOOL FULLSTACK MERN SNIPPESTS
co
const webdriver = require('selenium-webdriver')
const driver = new webdriver.Builder()
// The "9515" is the port opened by chrome driver.
.usingServer('http://localhost:9515')
.withCapabilities({
chromeOptions: {
// Here is the path to your Electron binary.
binary: 'C:\\Program Files\\Symphony\\Symphony\\Symphony.exe'
}
@KiranNiranjan
KiranNiranjan / index.html
Created October 29, 2020 04:59
Service Worker Notification
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Push Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="index.js"></script>
</head>
<body>
@KiranNiranjan
KiranNiranjan / README.md
Created October 10, 2023 08:59
Outloook Interop

Outlook Interop API

This application uses Microsoft.Office.Interop.Outlook API to extract outlook contact list. The contact can be further filtered by firsName or lastNamę̨