Skip to content

Instantly share code, notes, and snippets.

View praveenweb's full-sized avatar

Praveen Durairaju praveenweb

View GitHub Profile
import LogRocket from 'logrocket';
// Initialize LogRocket with your app ID
LogRocket.init(<your_application_id>);
import { applyMiddleware, createStore } from 'redux';
const store = createStore(
reducer, // your app reducer
applyMiddleware(middlewares, LogRocket.reduxMiddleware()),
);
LogRocket.identify('<user_id>', {
name: '<name>',
email: '<email>',
// Add your own custom user variables here, ie:
<custom_type>: '<custom_value'
});
fetch('http://example.com/todos')
.then(function(response) {
// some data processing
const first_todo = response.todos[0].text;
return first_todo;
})
.then(function(myJson) {
console.log(JSON.stringify(myJson));
});
docker run -d --name dd-agent -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -e DD_API_KEY=<your-api-key> datadog/agent:latest
docker run -d -v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /proc/:/host/proc/:ro \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
-e DD_API_KEY=<YOUR_API_KEY> \
-e DD_APM_ENABLED=true \
datadog/agent:latest
var tracer = require('dd-trace').init({
hostname: '<host-name>',
port: 8126,
debug: true
});
tracer.use('express');
require("honeycomb-beeline")({
writeKey: "<your-write-key>",
dataset: "node-js"
// ... additional optional configuration ...
});
<template>
<div>
<h3>Authors</h3>
<ul>
<li v-for="item in author" :key="item.id">
<nuxt-link :to="`/article/${item.id}`">
{{ item.name }}
</nuxt-link>
</li>
</ul>
@praveenweb
praveenweb / static.config.js
Created February 11, 2019 07:55
react-static routing with GraphQL data fetch
import client from './src/apollo'
import {GET_AUTHOR, GET_ARTICLE} from './src/graphql/queries'
export default {
getSiteData: () => ({
title: 'React Static with Hasura GraphQL',
}),
getRoutes: async () => {
const {
data: { author },