Skip to content

Instantly share code, notes, and snippets.

var http = require("http");
var app = http.createServer(function(req, res) {
res.setHeader("Content-Type", "application/json");
res.end(JSON.stringify({ name: "Mannir", age: 33, time: +new Date() }));
});
app.listen(8080);
import firebase from "firebase/app";
import "firebase/auth";
// Initialize Firebase
// TODO: Replace with your project's customized code snippet
var config = {
};
try {
firebase.initializeApp(config);
Last Added Value
var snap = await db
.ref("/readings")
.limitToLast(1)
.once("child_added");
let lastValue = snap.val();
console.log(lastValue);
const _ = require("lodash");
var admin = require("../../../src/mannir/firebase").getInstance();
let db = admin.firestore();
export default async (req, res) => {
var users = [];
var snapshot = await db.collection("users").get();
function App() {
const [nickname, setNickname] = useState("");
const [email, setEmail] = useState("");
const [joined, setJoined] = useState(false);
const [msg, setMsg] = useState("");
const [messages, setMessages] = useState({});
const chatRoom = db.ref().child('chatrooms').child('global');
useEffect(() => {
adminlte3:
js:
//adminlte.io/themes/dev/AdminLTE/plugins/jquery/jquery.min.js: {}
//adminlte.io/themes/dev/AdminLTE/plugins/jquery-ui/jquery-ui.min.js: {}
# //: {}
//adminlte.io/themes/dev/AdminLTE/plugins/bootstrap/js/bootstrap.bundle.min.js: {}
//adminlte.io/themes/dev/AdminLTE/plugins/chart.js/Chart.min.js: {}
//adminlte.io/themes/dev/AdminLTE/plugins/sparklines/sparkline.js: {}
//adminlte.io/themes/dev/AdminLTE/plugins/jqvmap/jquery.vmap.min.js: {}
//adminlte.io/themes/dev/AdminLTE/plugins/jqvmap/maps/jquery.vmap.usa.js: {}
{
"name": "mannir/firestore",
"require": {
"google/cloud-firestore": "^1.9"
},
"authors": [
{
"name": "Mannir",
"email": "manniru@gmail.com"
}
@manniru
manniru / gist:57278660deaf1b483822ce448205e41a
Created November 5, 2019 02:53 — forked from segebee/gist:7dde9de8e70a207e6e19
Nigeria States and Local Government Areas JSON - codingsavvy.com
[{"state":{"name":"Abia State","id":1,"locals":[{"name":"Aba South","id":1},{"name":"Arochukwu","id":2},{"name":"Bende","id":3},{"name":"Ikwuano","id":4},{"name":"Isiala Ngwa North","id":5},{"name":"Isiala Ngwa South","id":6},{"name":"Isuikwuato","id":7},{"name":"Obi Ngwa","id":8},{"name":"Ohafia","id":9},{"name":"Osisioma","id":10},{"name":"Ugwunagbo","id":11},{"name":"Ukwa East","id":12},{"name":"Ukwa West","id":13},{"name":"Umuahia North","id":14},{"name":"Umuahia South","id":15},{"name":"Umu Nneochi","id":16}]}},{"state":{"name":"Adamawa State","id":2,"locals":[{"name":"Fufure","id":1},{"name":"Ganye","id":2},{"name":"Gayuk","id":3},{"name":"Gombi","id":4},{"name":"Grie","id":5},{"name":"Hong","id":6},{"name":"Jada","id":7},{"name":"Lamurde","id":8},{"name":"Madagali","id":9},{"name":"Maiha","id":10},{"name":"Mayo Belwa","id":11},{"name":"Michika","id":12},{"name":"Mubi North","id":13},{"name":"Mubi South","id":14},{"name":"Numan","id":15},{"name":"Shelleng","id":16},{"name":"Song","id":17},{"name":"Toung
fetch('https://mannir.requestcatcher.com/test').then(
function(response){
// return response.json();
console.log(response)
}
);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Order Form</title>