Skip to content

Instantly share code, notes, and snippets.

Avatar

rohitsingh20122992

View GitHub Profile
View nginx.conf
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
View App.js
import React from 'react';
import { QueryRenderer } from 'react-relay';
import environment from './RelayEnvironment'
import graphql from 'babel-plugin-relay/macro';
import './tailwind.output.css';
export default class App extends React.Component {
//this.state = {farmCropId:1}
constructor(props) {
View RelayEnvironment.js
import {
Environment,
Network,
RecordSource,
Store,
} from 'relay-runtime';
function fetchQuery(
operation,
variables,
View package.json
{
"name": "relay-example",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
View relay.config.js
module.exports = {
// ...
// Configuration options accepted by the `relay-compiler` command-line tool and `babel-plugin-relay`.
src: "./src",
schema: "./data/schema.graphql",
exclude: ["**/node_modules/**", "**/__mocks__/**", "**/__generated__/**"],
}
View MetaData.java
public class MetaData {
private UUID uuid;
private String fileName;
private int startIndex;
private int lastIndex;
private int size;
}
View json-demo.go
package main
import "fmt"
import "encoding/json"
var m map[string]string
var mDup map[string]string
func main() {
m = make(map[string]string)
View struct-student.go
package main
import "fmt"
type Student struct {
Name string
Address string
Class string
}
View mapsDemo.go
func main() {
students := make(map[int]string)
students[0] = "Harsh"
students[1] = "Yash"
fmt.Println(students)
delete(students, 1)
fmt.Println(students)
students[1] = "Jain"
for roll, name := range students{
fmt.Printf("Roll number of %s is %d \n",name, roll)
View slicesDemo.go
func main() {
cricketer := []string{1:"Sachin", 2:"Ponting", 3: "Waugh", 4: "Zaheer", 5: "Waqar", 6:"Lee"}
batsman := cricketer[1:4]
bowler := cricketer[4:7]
fmt.Println(batsman)
fmt.Println(bowler)
cricketer = append(cricketer, "McGrath")
fmt.Println(bowler)
fmt.Println(cricketer)
You can’t perform that action at this time.