Discover gists
This file contains 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 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); |
This file contains 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
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); |
This file contains 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
Last Added Value | |
var snap = await db | |
.ref("/readings") | |
.limitToLast(1) | |
.once("child_added"); | |
let lastValue = snap.val(); | |
console.log(lastValue); |
This file contains 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
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(); |
This file contains 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
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(() => { |
This file contains 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
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: {} |
This file contains 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
{ | |
"name": "mannir/firestore", | |
"require": { | |
"google/cloud-firestore": "^1.9" | |
}, | |
"authors": [ | |
{ | |
"name": "Mannir", | |
"email": "manniru@gmail.com" | |
} |
This file contains 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
[{"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 |
This file contains 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
fetch('https://mannir.requestcatcher.com/test').then( | |
function(response){ | |
// return response.json(); | |
console.log(response) | |
} | |
); | |
This file contains 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
<!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> |
NewerOlder