Skip to content

Instantly share code, notes, and snippets.

View Gitart's full-sized avatar
🎨
Working from home

Arthur Savage Gitart

🎨
Working from home
  • ART TECH
  • Ukraine
  • 02:22 (UTC +03:00)
View GitHub Profile
@Gitart
Gitart / bootstrap-starter-nav.pug
Created April 21, 2024 09:32 — forked from tdreid/bootstrap-starter-nav.pug
Bootstrap 4 examples as Pug templates
doctype html
html(lang="en")
head
meta(charset="utf-8")
meta(name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no")
title Bootstrap 4 Starter With Nav
link(rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous")
body
nav.navbar.navbar-expand-md.navbar-dark.bg-dark.fixed-top
a.navbar-brand(href="#") BRAND

🧾 EXAMPLE DOCUMENTS FOR COMPANY AAA

Here is a simple footnote1.

A footnote can also have multiple lines2.

Footnotes

  1. My reference.

  2. To add line breaks within a footnote, prefix new lines with 2 spaces. This is a second line.

@Gitart
Gitart / main.go
Created January 4, 2024 11:50 — forked from ayoisaiah/main.go
Multipart requests in Go (feat Google Drive API)
package main
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"mime/multipart"
"net/http"
"net/textproto"
@Gitart
Gitart / cache.go
Created December 31, 2023 16:55 — forked from alexedwards/cache.go
Generic in-memory cache implementation in Go
package cache
import (
"sync"
"time"
)
// Cache is a basic in-memory key-value cache implementation.
type Cache[K comparable, V any] struct {
items map[K]V // The map storing key-value pairs.
@Gitart
Gitart / array_iteration_thoughts.md
Created September 15, 2023 17:47 — forked from ljharb/array_iteration_thoughts.md
Array iteration methods summarized

Array Iteration

https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu

/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@Gitart
Gitart / render_number.go
Created March 11, 2023 13:08 — forked from gorhill/render_number.go
A Go function to render a number to a string based on the following user-specified criteria: thousands separator, decimal separator, decimal precision. I didn't feel it was worth to publish a library just for this piece of code, hence the snippet. Feel free to reuse as you wish.
/*
Author: https://github.com/gorhill
Source: https://gist.github.com/gorhill/5285193
A Go function to render a number to a string based on
the following user-specified criteria:
* thousands separator
* decimal separator
@Gitart
Gitart / ConnNumOfTransport.go
Created November 30, 2022 16:01 — forked from HattieWebb/ConnNumOfTransport.go
get open connection num from a *http.Transport
package main
import (
"sync"
"net/http"
"time"
"io/ioutil"
"fmt"
"net"
"context"
gitGraph
checkout main
commit
commit
branch system
commit
commit
commit
from websocket import create_connection
import json
# Copy the web brower header and input as a dictionary
headers = json.dumps({
'Pragma': 'no-cache',
'Origin': 'https://www.cryptocompare.com',
'Accept-Language': 'en-US,en;q=0.9',
'Sec-WebSocket-Key': 'QknTzkhVwUs8UY+xAE22Kg==',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36',