Skip to content

Instantly share code, notes, and snippets.

View tkssharma's full-sized avatar
🎯
only JS

codewithtkssharma tkssharma

🎯
only JS
View GitHub Profile
<html>
<head>
<title>Display Property</title>
<style>
#main{
height: 100px;
width: 200px;
background: teal;
display: block;
import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';
export const Teams = new Mongo.Collection('teams');
if (Meteor.isServer) {
// This code only runs on the server
Meteor.publish('teams', function groupPublication() {
return Teams.find();
});
class todosContainer extends React.Component {
constructor(props) {
super(props);
this.state = {
loading: false,
todos: {}
}
}
createNewTodo(data){
Meteor.call('todo.insert', data, function(err){
getUserData() {
const id = Meteor.userId();
if (id) {
const data = Meteor.users.findOne({ _id: id });
if(data){
console.log(data)
}
}
}
handleLogin(data) {
Meteor.startup(() => {
ServiceConfiguration.configurations.remove({
service: "facebook"
});
ServiceConfiguration.configurations.insert({
service: "facebook",
appId: '***********',
secret: '*******************'
const port = 3000
require('http')
.createServer((req, res) => {
})
.listen(port, (error)=>{
console.log(`server is running on ${port}`)
})
const {rewireWorkboxInject, defaultInjectConfig} = require('react-app-rewire-workbox');
const path = require('path');
module.exports = function override(config, env) {
if (env === "production") {
console.log("Production build - Adding Workbox for PWAs");
// Extend the default injection config with required swSrc
const workboxConfig = {
...defaultInjectConfig,
swSrc: path.join(__dirname, 'src', 'custom-sw.js')
{
"name": "react-with-workbox",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.19.0",
"eslint-config-prettier": "^6.1.0",
"prettier": "^1.18.2",
"react": "^16.4.2",
"react-app-rewire-workbox": "^2.0.1",
/* eslint-disable no-undef */
// See https://developers.google.com/web/tools/workbox/guides/configure-workbox
workbox.core.setLogLevel(workbox.core.LOG_LEVELS.debug);
self.addEventListener('install', event => event.waitUntil(self.skipWaiting()));
self.addEventListener('activate', event => event.waitUntil(self.clients.claim()));
workbox.routing.registerRoute(
new RegExp('.css$'),
workbox.strategies.cacheFirst({
export default function register() {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
return;
}