Skip to content

Instantly share code, notes, and snippets.

View vsg24's full-sized avatar

Vahid Amiri Motlagh vsg24

View GitHub Profile
@vsg24
vsg24 / paywall.js
Last active September 30, 2022 11:08
Thelocal.dk paywall remover for Tempermonkey
// ==UserScript==
// @name Paywall Remover
// @namespace https://srizon.com/
// @version 0.1
// @description Remove Paywall from thelocal.dk and thelocal.de
// @author Afzal
// @match https://www.thelocal.dk/*
// @match https://www.thelocal.de/*
// @require http://code.jquery.com/jquery-latest.js
// @grant none
@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 webmaster@dummy-host.example.com
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"
)