Skip to content

Instantly share code, notes, and snippets.

@gocs
gocs / support for password authentication was removed.md
Last active July 2, 2022 13:26
remote: Support for password authentication was removed

got this error when using gh?

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/<user>/<repo>/'

my approach is to re-authenticate gh

@gocs
gocs / auth\auth.go
Created June 3, 2022 06:47
simple auth web app
package auth
import (
"errors"
"html/template"
"log"
"net/http"
"time"
"github.com/go-chi/jwtauth/v5"
@gocs
gocs / cdn.md
Last active February 27, 2022 13:49
i.i.i.imamamamagecddn-unseodable

image

image

@gocs
gocs / form-select-onchange-onsubmit.html
Created October 8, 2021 10:42
add function before FROM SELECT ONCHANGE ONSUBMIT;
<form method="post" onchange="post_to_popup(this);this.submit();">
<select></select>
</form>
@gocs
gocs / format_phone.php
Last active October 7, 2021 05:27
validate or format phone number in php
/**
* FormatPhone formats phone number
* @param string $number phone number
*
* @return int formatted phone number
*
*/
function FormatPhone($phone)
{
$rx = "/
@gocs
gocs / fixed-header-and-scrollable-contents.html
Last active December 1, 2021 07:15
example of fixed header and scrollable contents using flexbox
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>fixed header and scrollable contents</title>
<style>
body {
margin: 0;
@gocs
gocs / docker-compose.yml
Created June 18, 2021 09:42
adminer docker with custom css
version: '3.3'
services:
adminer:
image: adminer
restart: always
ports:
- 8080:8080
volumes:
- type: bind
@gocs
gocs / http.go
Created January 17, 2021 10:32
http: superfluous response.WriteHeader call from
func Error(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest)
// w.Write's order must be written after you set the w.Writeheader
w.Write([]byte("error message"))
}
package main
import (
"fmt"
)
func main() {
js := []Job{
{pno: 1, prio: 2, at: 0, bt: 4},
{pno: 2, prio: 4, at: 1, bt: 2},
@gocs
gocs / jsfrick.js
Last active May 2, 2020 13:54
javascript's available alphabets without using alphabets
// javascript available alphabets got without using alphabets
// one of the limitiations are some uppercase layers
// which could only be solved if I have uppercase `C`
/******************************************************************************
* below are some strings generated by some identities
*
* true
* false