Skip to content

Instantly share code, notes, and snippets.

View ashutosh887's full-sized avatar
:octocat:
Give them a reason to remember your name!

Ashutosh Jha ashutosh887

:octocat:
Give them a reason to remember your name!
View GitHub Profile
@ashutosh887
ashutosh887 / preview.json
Created October 20, 2023 04:34
Slack Message Template
{
"blocks": [
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "*`Firing`: Latency P99 on orders-demo exceeds threshold*"
}
]
@ashutosh887
ashutosh887 / FavOverflow
Last active February 24, 2023 10:06
Favorite StackOverflow Answers!
Git push statistics:
https://stackoverflow.com/a/21484013
Disable Screenshot in App:
https://stackoverflow.com/a/54998200
func (hs *HTTPServer) addAPMPanelToHomeDashboard(c *models.ReqContext, dash *simplejson.Json) {
// check org if dashboard exists -> apm
// 1. if not exist in org - return
dashboardExistInOrg := true
if !dashboardExistInOrg {
return
}
// generate dashbaord
// create json and append to home json
1. DeprecationWarning: Mongoose: the `strictQuery` option will be switched back to `false` by default in Mongoose 7
mongoose.set("strictQuery", false);
mongoose
.connect(process.env.MONGO_URL, {
useUnifiedTopology: true,
useNewUrlParser: true,
})
.then(() => {
console.log(`MongoDB Server connected successfully...`);
import React, { useEffect, useState } from "react";
import {
FlatList,
Image,
ScrollView,
Text,
View,
RefreshControl,
Pressable,
} from "react-native";
@ashutosh887
ashutosh887 / useCustomHTTP.js
Created April 23, 2022 04:47
Custom Hook for React HTTP Calls
// useCustomHTTP HOOK
// To reuse our Custom HTTP Request Logic in across multiple components
import { useCallback, useState } from "react";
const useCustomHTTP = () => {
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState(null);