This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: <your_image> | |
pipelines: | |
default: | |
- step: | |
name: <description> | |
deployment: <your_deployment_name> | |
image: google/cloud-sdk:320.0.0-alpine | |
script: | |
# on linux you can use `$ base64 -w 0 < ~/.google_app_credentials.json` to generate $GCP_KEY_FILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
) | |
type Page struct { | |
URL string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import time | |
from pathlib import Path | |
from functools import reduce | |
def get_previous_num(num, shift): | |
last_part = num & (1 << shift) - 1 | |
first_part = num >> (shift * 2) << shift | |
return last_part + first_part |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
import itertools | |
import reprlib | |
from sorted_set import SortedSet | |
def full_sig(method): | |
try: | |
return method.__name__ + str(inspect.signature(method)) | |
except ValueError: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"github.com/gorilla/mux" | |
"log" | |
"math/rand" | |
"net/http" | |
"strconv" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import os | |
import time | |
import uuid | |
import json | |
import asyncio | |
import typing as typ | |
import urllib.parse as urlparse | |
from argparse import ArgumentParser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import uuid | |
import asyncio | |
import typing as typ | |
import urllib.parse as urlparse | |
from lxml import html | |
from aiohttp import ClientSession |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func fibonacci() func() int { | |
x1 := 0 | |
x2 := 1 | |
res := 0 | |
return func() int { | |
res, x1, x2 = x1, x2, x1 + x2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"golang.org/x/tour/wc" | |
"strings" | |
) | |
func WordCount(s string) map[string]int { | |
count := make(map[string]int) | |
words := strings.Fields(s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"strconv" | |
"strings" | |
) | |
type IPAddr [4]byte |
NewerOlder