Skip to content

Instantly share code, notes, and snippets.

View vsg24's full-sized avatar

Vahid Amiri Motlagh vsg24

View GitHub Profile
@vsg24
vsg24 / AppleLoginVerify.php
Created March 5, 2025 15:29
Verify Apple Login JWT in Laravel
<?php
namespace App\Actions;
use Firebase\JWT\JWK;
use Illuminate\Support\Facades\Cache;
use Firebase\JWT\JWT;
use GuzzleHttp\Client;
use Exception;
@vsg24
vsg24 / worker.js
Created July 6, 2021 09:30
Running your own CORS proxy using Cloudflare Workers
async function handleRequest(request) {
const url = new URL(request.url)
let apiUrl = url.searchParams.get('apiurl')
if (apiUrl == null) {
apiUrl = API_URL
}
// Rewrite request to point to API url. This also makes the request mutable
// so we can add the correct Origin header to make the API server think
// that this request isn't cross-site.
request = new Request(apiUrl, request)
@vsg24
vsg24 / .conf
Created July 2, 2020 10:33
apache mod_php config
LoadModule php7_module "C:/Program Files/php-7.4.2-Win32-vc15-x64/php7apache2_4.dll"
AddHandler application/x-httpd-php .php
AddType application/x-httpd-php .php .html
PHPIniDir "C:/Program Files/php-7.4.2-Win32-vc15-x64"
@vsg24
vsg24 / c
Created May 31, 2020 12:45
rc switch send+receive
/*
Example for receiving
https://github.com/sui77/rc-switch/
If you want to visualize a telegram copy the raw data and
paste it into http://test.sui.li/oszi/
*/
#include <RCSwitch.h>
@vsg24
vsg24 / httpd-vhosts.conf
Last active April 27, 2020 12:05
Apache 2.4 PHP virtualhost example
```
<VirtualHost *:80>
AddHandler application/x-httpd-php .php
ServerAdmin [email protected]
DocumentRoot "C:/Users/Vahid Amiri Motlagh/Documents/dev/phpmyadmin"
ServerName phpmyadmin.localhost
ServerAlias www.phpmyadmin.localhost
ErrorLog "C:/Program Files/Apache24/logs/phpmyadmin.localhost-error.log"
CustomLog "C:/Program Files/Apache24/logs/phpmyadmin.localhost-access.log" common
<Directory "C:/Users/Vahid Amiri Motlagh/Documents/dev/phpmyadmin">
@vsg24
vsg24 / myapp.go
Created December 20, 2018 11:05
How to install Go app as a Windows service
package main
import (
"fmt"
"github.com/kardianos/service"
"log"
"os"
"time"
)