Skip to content

Instantly share code, notes, and snippets.

package add
import (
"fmt"
"testing"
)
func TestAdd(t *testing.T) {
expected := 5
package add
func Add(a int, b int) int {
return a + b
}
package main
import (
"encoding/json"
"fmt"
)
type City struct {
Population float64 `json:"population"` // population in millions
Name string `json:"name"`
package main
import (
"fmt"
"sync"
)
func main() {
wg := new(sync.WaitGroup) //create a wait group
package main
import (
"fmt"
"sync"
)
func main() {
wg := new(sync.WaitGroup) //create a wait group
package main
import (
"context"
"fmt"
"golang.org/x/sync/errgroup"
)
func main() {
package main
import (
"fmt"
)
func main() {
numberCh := make(chan int, 10)
import axios from 'axios';
axios.interceptors.request.use(
function (config) {
let token = localStorage.getItem('access_token');
if (token && token !== 'null') {
config.headers.common['Authorization'] = 'Bearer ' + token;
}
return config;
@developernaren
developernaren / index.php
Created July 7, 2020 19:10
Fetch images from a url
<?php
//dependencies
//"clue/buzz-react": "^2.9",
//"symfony/dom-crawler": "^5.1",
//"clue/mq-react": "^1.2"
require_once './vendor/autoload.php';
$url = 'http://example.com/site-with-images';
web:
image: nginx:latest
ports:
- "8080:80"
volumes:
- ./public://var/www/api.pagevamp/public
- ./:/var/www/api.pagevamp
- ./pagevamp.conf:/etc/nginx/conf.d/default.conf
links:
- php