Skip to content

Instantly share code, notes, and snippets.

View narenaryan's full-sized avatar
🏠
Dreaming Big

N3N narenaryan

🏠
Dreaming Big
View GitHub Profile
{
"languages": {
"python": {
"name": "Python",
"author": "Guido Van Rossum",
"usedFor": ["Scripting", "Web Development", "Text processing", "Data Science"]
},
"go": {
"name": "Go",
"author": "Google",
@narenaryan
narenaryan / loads.py
Last active September 12, 2022 12:46
Helper snippet for JSON article on medium
import json
# JSON string
foo = "[1, 2, 3]"
# Decoded result
result = json.loads(foo)
print(result) # prints [1, 2, 3]
print(type(result)) # prints <class 'list'>
package main
import (
"bytes"
"fmt"
"io"
"os"
)
// Your function
package main
import (
"fmt"
"io"
)
func main() {
pr, pw := io.Pipe()
package main
import (
"bytes"
"fmt"
"io"
"strings"
)
func main() {
package main
import (
"bytes"
"fmt"
"strings"
)
func main() {
// Create a reader
package main
import (
"bytes"
"fmt"
"strings"
)
func main() {
// Create a reader
package main
import (
"fmt"
"io"
"strings"
)
func main() {
// Create two readers
package main
import (
"fmt"
"io"
"strings"
)
func main() {
// Create a new reader (Readonly)
package main
import (
"bytes"
"fmt"
"io"
)
func main() {
// Two empty buffers