Skip to content

Instantly share code, notes, and snippets.

View alirezaarzehgar's full-sized avatar
😃
Focusing

Ali alirezaarzehgar

😃
Focusing
  • Iran, mashhad
View GitHub Profile
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;
class Database {
fstream table;
public:
@alirezaarzehgar
alirezaarzehgar / remove-all-origins.sh
Created December 8, 2023 11:28
Remove every repository on github and push FU!
#!/usr/bin/bash
shopt -s extglob
git config --global user.name "Fucker"
git config --global user.email "fucker@yourmother.org"
for dir in $(ls -d */); do
cd $dir
git fetch --prune
git checkout --orphan delete
@alirezaarzehgar
alirezaarzehgar / swagger-static.sh
Created November 30, 2023 20:35
Use swagger static
#!/usr/bin/env bash
SWAGGER_JSON_PATH=/tmp/docs/swagger.json
SWAGGER_VERSION=5.10.3
SWAGGER_RELEASE=https://github.com/swagger-api/swagger-ui/archive/refs/tags/v${SWAGGER_VERSION}.zip
DIRNAME=swagger-ui-${SWAGGER_VERSION}
wget --no-clobber ${SWAGGER_RELEASE} -O swag.zip
unzip swag.zip
@alirezaarzehgar
alirezaarzehgar / bomber.go
Created November 14, 2023 06:39
SMS bomber with go
package main
import (
"bufio"
"bytes"
"encoding/json"
"flag"
"fmt"
"log"
"net/http"
@alirezaarzehgar
alirezaarzehgar / test-payment.go
Created September 23, 2023 14:59
Connect golang application to payment gateway
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
// https://aqayepardakht.ir/api/
@alirezaarzehgar
alirezaarzehgar / server.go
Created August 17, 2023 05:09
Simplest golang websocket chat server
package main
import (
"log"
"net/http"
"github.com/gorilla/websocket"
)
func main() {
@alirezaarzehgar
alirezaarzehgar / rumination.go
Created July 31, 2023 11:27
I use this snippet for counting my mind ruminations. I think this technique can stop rumination after some times.
package main
import (
"errors"
"fmt"
"io/fs"
"log"
"os"
"strconv"
)
@alirezaarzehgar
alirezaarzehgar / main.go
Created July 11, 2023 19:21
Self-Referential Has One in GORM
package main
import (
"fmt"
"log"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
)
@alirezaarzehgar
alirezaarzehgar / rsug.go
Last active July 8, 2023 09:27
Suggestions assistant
package main
import (
"encoding/json"
"log"
"math"
"math/rand"
"os"
"time"
@alirezaarzehgar
alirezaarzehgar / main.go
Last active July 1, 2023 20:07
database/sql demo
package main
import (
"database/sql"
"errors"
"os"
"strconv"
_ "github.com/mattn/go-sqlite3"
"github.com/pterm/pterm"