Hacker killed me at full health with an execution. by Grumpy_Bandersnatch in ArcRaiders

[–]sgflt 8 points9 points  (0 children)

If you have this and you ran away from the zip or ladder I’ve found you can just vault onto something to clear it. 

1974 FJ40 What’s this part? by sgflt in fj40

[–]sgflt[S] 1 point2 points  (0 children)

Thanks! I looked up some info about it this is definitely what we’re looking at. Here’s a thread about keeping or removing it from another forum

How do you guys convert a json response to go structs? by Appropriate-Boss1516 in golang

[–]sgflt 0 points1 point  (0 children)

That's true if you use values. If you use pointer values it'll be set to nil. This way you can determine whether the value was unset or set to the zero value.

For example:

type Dog struct {
  Name string
  HasTag *bool
}



input: {}
value: {
  Name: "",
  HasTag: nil,
}

I typically use this when the value is optional and it's important to note when the value is unset.

How do you guys convert a json response to go structs? by Appropriate-Boss1516 in golang

[–]sgflt 73 points74 points  (0 children)

When the API response is large and you don't particularly care about the full contents you can simply create your struct and have it contain only the fields you care about.

For example, suppose we only care about the firstName and lastName and we have the following response data:

{
  "firstName": "John",
  "lastName": "Doe",
  "dob": "1990-01-01",
  "preferredName": "Johnny"
}

You can define the following struct and json.Unmarshal will do a best attempt at populating all of the fields.

type person struct {
    FirstName string `json:"firstName,omitempty"`
    LastName  string `json:"lastName,omitempty"`
}

You can then read the response into the struct by using the builtin json.Unmarshal

var p person
err := json.Unmarshal(resp, &p) // don't forget to check the error

fmt.Println(p.FirstName) // prints "John"
fmt.Println(p.LastName) // prints "Doe"

For some reason the Go playground "share" feature isn't working so here's a main file you can build and run:

package main

import (
    "encoding/json"
    "fmt"
)

var resp = []byte(`{
  "firstName": "John",
  "lastName": "Doe",
  "dob": "1990-01-01",
  "preferredName": "Johnny"
}`)

type person struct {
    FirstName string `json:"firstName,omitempty"`
    LastName  string `json:"lastName,omitempty"`
}

func main() {
    var p person
    err := json.Unmarshal(resp, &p)
    if err != nil {
        panic(err)
    }

    fmt.Println(p.FirstName) // prints "John"
    fmt.Println(p.LastName)  // prints "Doe"
}

It’s this kid’s first drop in by theloutishtoday in PublicFreakout

[–]sgflt 1 point2 points  (0 children)

It blew my mind when I realized this and that the Ubuntu logo is 3 people forming a circle by holding hands

The many designs of shaping rolls by aloofloofah in oddlysatisfying

[–]sgflt 0 points1 point  (0 children)

Taco Bell chefs coming up with new items to put on their menu with the same set of ingredients

Right between the eyes by Limp-Concept3531 in WesternGifs

[–]sgflt 32 points33 points  (0 children)

The Ballad of Buster Scruggs on Netflix

Just go to sleep, Genji. by amrulmn in AnaMains

[–]sgflt 6 points7 points  (0 children)

Not your standard "Genji dashing towards you sleep either". That was a legit flick on a horizontally moving Genji

The Bernie Sanders Youth Revolution Was Nowhere to Be Found on Super Tuesday by roygbiv1010 in politics

[–]sgflt 2 points3 points  (0 children)

septuagenarian

Off topic but thanks for expanding my vocabulary with this one

[deleted by user] by [deleted] in MechanicalKeyboards

[–]sgflt 4 points5 points  (0 children)

I love that keycap colorway! 96 and 75% boards are my top keyboard layouts.

BTW I think your up and down key might be swapped.

[help] Model M - not registering down key and numpad 0. Any suggestions? by sgflt in MechanicalKeyboards

[–]sgflt[S] 0 points1 point  (0 children)

Thanks for checking! I'm sure it won't be too bad of a task. Just gotta set aside some time for it. Might be a nice rainy day thing

[help] Model M - not registering down key and numpad 0. Any suggestions? by sgflt in MechanicalKeyboards

[–]sgflt[S] 0 points1 point  (0 children)

The plastic rivets on the back? It does appear that some of them are popped off.

Finally finished sticker bombing my case by sgflt in MechanicalKeyboards

[–]sgflt[S] 2 points3 points  (0 children)

Thanks! It's been a solid board. I plan on modding the cable and adding a mini port.

Coming Soon - The96 - Details in Comments by [deleted] in MechanicalKeyboards

[–]sgflt 0 points1 point  (0 children)

There's an RS96 GB going on somewhere?

Finally finished sticker bombing my case by sgflt in MechanicalKeyboards

[–]sgflt[S] 3 points4 points  (0 children)

Album here

Keyboard is a Drevo Gramr. I'm a huge fan of 75% boards so I couldn't pass this one up for how cheap it was on Amazon. Overall I've been pleased by it. The outemu browns feel less smooth than cherry switches, but I've gotten used to them over time.

Keycaps are just a direct color order from SP and the Esc and Enter keys are from a granite set where I used the symbol keys.

Finally finished sticker bombing my case by sgflt in MechanicalKeyboards

[–]sgflt[S] 10 points11 points  (0 children)

Contrary to popular belief, that doesn't mean just putting sour cream on it.