Skip to content

Instantly share code, notes, and snippets.

View WahidinAji's full-sized avatar
🐲
The Power Of Anu🔥🔥🔥

Cakrawala WahidinAji

🐲
The Power Of Anu🔥🔥🔥
View GitHub Profile
@WahidinAji
WahidinAji / bash.sh
Created February 6, 2025 12:13
install docker on linux properly
#remove existing one
sudo dnf remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
#setup repo
sudo dnf -y install dnf-plugins-core
sudo dnf-3 config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
#install the engine
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
#start engine
@WahidinAji
WahidinAji / index.rs
Created January 8, 2025 07:28
php .ini location in macbook arm
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Finally, check DirectoryIndex includes index.php
DirectoryIndex index.php index.html
import { NextApiRequest, NextApiResponse } from 'next';
let callbackURL = 'http://localhost:9000/api/v1/auth/google/callback';
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const { code, state } = req.query;
if (req.method === 'GET') {
try {
let cookie = req.headers.cookie;
@WahidinAji
WahidinAji / main.go
Created July 27, 2024 13:46
Go + htmx simple sample
package main
import (
"html/template"
"io"
"log"
"net/http"
"github.com/labstack/echo/v4"
)
@WahidinAji
WahidinAji / go.go
Last active January 19, 2024 08:51
badWors
package main
import (
"fmt"
"strings"
)
type BadWord struct {
Word string
}
@WahidinAji
WahidinAji / Database.php
Last active March 30, 2024 04:21
anu php
<?php
class Database
{
private static $pgInstance = null;
private \PDO $pdo;
public function __construct($host, $port, $dbname, $user, $password)
{
$dsn = sprintf("pgsql:host=%s;port=%d;dbname=%s", $host, $port, $dbname);
try {
$this->pdo = new \PDO($dsn, $user, $password);
@WahidinAji
WahidinAji / main.go
Last active December 1, 2023 07:07
no description
package main
import (
"fmt"
"time"
)
func main() {
//make a program standby
times := make(chan time.Time)
@WahidinAji
WahidinAji / typesense.sh
Last active November 1, 2023 13:44
running TypeSense on your local machine with docker
#pull the image
docker pull typesense/typesense:0.26.0.rc25
#run you image as containe
#- make sure you are in Documents directory
cd Documents
makdir typesense-data
@WahidinAji
WahidinAji / FromSqlInterpolatedStringHandler.cs
Created May 15, 2023 10:19 — forked from davidfowl/FromSqlInterpolatedStringHandler.cs
Implementation of parameterized sql queries using string interpolation handlers
using System.Data.Common;
using System.Runtime.CompilerServices;
using System.Text;
using Npgsql;
GetCatalogItemsSql(null, null, null, 10);
void GetCatalogItemsSql(int? catalogBrandId, int? before, int? after, int pageSize)
{
// This looks like it would be susceptible to SQL injection, but it's not.
@WahidinAji
WahidinAji / multipart_upload.go
Created November 12, 2022 08:17 — forked from mattetti/multipart_upload.go
Example of doing a multipart upload in Go (golang)
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"