Skip to content

Instantly share code, notes, and snippets.

View HttpUploadServerInitializer.java
package my.netty.http.upload;
import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.codec.http.HttpRequestDecoder;
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)