Skip to content

Instantly share code, notes, and snippets.

View AnjanaMadu's full-sized avatar
:shipit:
Luv open source

Anjana Madu AnjanaMadu

:shipit:
Luv open source
View GitHub Profile
@AnjanaMadu
AnjanaMadu / streamFile.go
Created January 15, 2024 14:09
Go code to stream file to client which hasn't completed
package main
import (
"net/http"
"os"
"time"
)
// function to generate file in 10 seconds
func generateFile(done chan bool) {
@AnjanaMadu
AnjanaMadu / install-ffmpeg.ps1
Created April 10, 2023 15:08
A powershell script to install ffmpeg in windows easily
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
if (!$isAdmin) {
Write-Host "Please run this script as administrator."
exit
}
if (Get-Command ffmpeg -ErrorAction SilentlyContinue) {
Write-Host "ffmpeg is already installed."
exit
}
@AnjanaMadu
AnjanaMadu / http-post-progress.go
Created September 18, 2022 12:36
Golang http multipart post upload/sent progress tracker.
package main
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"mime/multipart"
"net/http"
"os"
@AnjanaMadu
AnjanaMadu / detect-ad-blocker.html
Created May 23, 2022 13:58
A script or code can detect whether the client uses or enable the ad blocker.
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$.ajax({
url: 'https://static.doubleclick.net/instream/ad_status.js',
success: function( data ) {
console.log("Ads loaded");
},
error: function( data ) {
console.log("You're using an ad blocker.");
document.body.innerHTML = '<center><br><h1>Turn off your Ads Blocker and refresh the page!</h1></center>';
@AnjanaMadu
AnjanaMadu / du.txt
Created November 20, 2021 13:01
DownloadUpdater
v1.0