Skip to content

Instantly share code, notes, and snippets.

View GeekyGeeky's full-sized avatar

GeekyGeeky GeekyGeeky

View GitHub Profile
<?php
// required headers
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Max-Age: 3600");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
include_once '../config/database.php';
include_once '../objects/product.php';
<?php
// required headers
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Max-Age: 3600");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
include_once '../config/database.php';
Theme(
// use themedata to alter the styling of the child widgets
data: ThemeData(primarySwatch: Colors.purple),
child: Builder(builder: (c) {
return FlatProgressButton(
onPressed: () async {
_paystackDialog(c);
},
import { defineNuxtPlugin } from '#app'
import axios from 'axios'
import { useAuthStore } from '~/stores/auth'
export default defineNuxtPlugin(({ $pinia }) => {
return {
provide: {
axios: ({ use_auth }: Record<string, any> = {}) => {
let headers = { 'Content-Type': 'application/json' };
if (use_auth) {
@GeekyGeeky
GeekyGeeky / UserController.php
Created November 18, 2024 14:33
Sample of offset pagination in Laravel
<?php
class UserController {
protected $properties = ["id", "first_name", "last_name", "phone", "email", "created_at"];
protected function getPaginatedData(string $key, LengthAwarePaginator $data)
{
return [
$key => $data->items(),
@GeekyGeeky
GeekyGeeky / task_manager_cli.go
Created December 17, 2024 05:26
Simple Task Manager CLI App in Golang
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
tasks := []string{}
@GeekyGeeky
GeekyGeeky / drag-and-drop-html-gist-1.md
Last active January 13, 2025 02:07
Interactive Drag and Drop HTML Design
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-   <title>Document</title>
+   <title>Interactive File Upload Demo</title>
 
@GeekyGeeky
GeekyGeeky / drag-and-drop-html-gist-2.md
Created January 13, 2025 02:28
Interactive Drag and Drop
  <head>
  
+  <style>
+     body {
+       font-family: Arial, sans-serif;
+       padding: 20px;
+       background-color: #f9f9f9;
+     }