Skip to content

Instantly share code, notes, and snippets.

View john-nash-rs's full-sized avatar
🎯
Focusing

Harsh Vardhan john-nash-rs

🎯
Focusing
View GitHub Profile
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__/**"],
}
public class MetaData {
private UUID uuid;
private String fileName;
private int startIndex;
private int lastIndex;
private int size;
}
package main
import "fmt"
import "encoding/json"
var m map[string]string
var mDup map[string]string
func main() {
m = make(map[string]string)
package main
import "fmt"
type Student struct {
Name string
Address string
Class string
}
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)
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)
func main() {
var a [3]int = [3]int{1,2,3}
fmt.Println("Element at index is",a[1])
fmt.Println("Length of array is",len(a))
for i, v := range(a){
fmt.Printf("Index is %d, and value is %d \n",i,v)
}
q := [...]int{1, 2, 3}
package main
import "fmt"
func main(){
var x complex128 = complex(1, 2)
var y complex128 = complex(3, 4)
fmt.Println(x*y)
fmt.Println(real(x*y))
fmt.Println(imag(x*y))
func main(){
f := 100
x := &f
fmt.Printf(" value of f is %d and the address where f is stored %x \n", f, x);
*x = *x * 2
fmt.Printf(" value of f is %d and the address where f is stored %x \n", f, x);
}
package main
import "fmt"
const boilingF = 212.0
func main(){
var f = boilingF
var c = (f - 32) * 5/9;
fmt.Printf(" boiling point in Centigrade %g and in Fahrenheit %g \n", c, f);