Skip to content

Instantly share code, notes, and snippets.

View Abhinav1217's full-sized avatar

Abhinav Kulshreshtha Abhinav1217

View GitHub Profile
@sebble
sebble / stars.sh
Last active February 17, 2024 16:49
List all starred repositories of a GitHub user.
#!/bin/bash
USER=${1:-sebble}
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-)
PAGES=$((658/100+1))
echo You have $STARS starred repositories.
echo
@JosephShenton
JosephShenton / ddosl7.php
Created September 8, 2017 03:38
Layer 7 DDoS Protection PHP
<?php
$key = "La1az>T.}+w:uMoZ"; // CHANGE THIS STRING
$code = md5($_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_HOST'].$key);
$cookie = isset($_COOKIE['l7code']) ? $_COOKIE['l7code'] : FALSE ;
$ignored_uri = array();
$ignore = false;
foreach($ignored_uri as $u){
function logColor(color, args) {
console.log(`%c ${args.join(' ')}`, `color: ${color}`);
}
const log = {
aliceblue: (...args) => { logColor('aliceblue', args)},
antiquewhite: (...args) => { logColor('antiquewhite', args)},
aqua: (...args) => { logColor('aqua', args)},
aquamarine: (...args) => { logColor('aquamarine', args)},
azure: (...args) => { logColor('azure', args)},
@PasanBhanu
PasanBhanu / CheckNetwork.java
Last active July 25, 2023 13:28
Check Internet Connection in Android (API Level 29) Using Network Callback
/*
You need to call the below method once. It register the callback and fire it when there is a change in network state.
Here I used a Global Static Variable, So I can use it to access the network state in anyware of the application.
*/
// You need to pass the context when creating the class
public CheckNetwork(Context context) {
this.context = context;
}
@moqmar
moqmar / .bashrc
Last active February 23, 2024 06:57
My tiny & awesome .bashrc
###################################################################################################
# This is a very simple .bashrc file that I'm using on a daily basis. #
# It completely replaced my zsh setup, and should be relatively simple to understand and modify. #
# #
# Built by Moritz (mo-mar.de) - just do whatever you want with it, according to the Unlicense: #
# https://choosealicense.com/licenses/unlicense/ #
# #
# Simple installation: #
# wget https://go.momar.de/bashrc -O ~/.bashrc #
###################################################################################################
@gotbletu
gotbletu / comic2cbz
Created August 30, 2021 19:46
comic2cbz - convert images to webp at 50% quality and create cbz (comicbook archive)"
#!/usr/bin/env bash
# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry)
helpmsg() {
printf "%s\n" "desc: convert images to webp at 50% quality and create cbz (comicbook archive)"
printf "%s\n" "depend: imagemagick zip coreutils libwebp"
printf "\n"
printf "%s\n" "usage: ${0##*/} <image>"
printf "\n"
printf "%s\n" " $ ${0##*/} *.png"
@slimsag
slimsag / ramblings.md
Last active December 13, 2023 08:02
Because cross-compiling binaries for Windows is easier than building natively

Because cross-compiling binaries for Windows is easier than building natively

I want Microsoft to do better, want Windows to be a decent development platform-and yet, I constantly see Microsoft playing the open source game: advertising how open-source and developer friendly they are - only to crush developers under the heel of the corporate behemoth's boot.

The people who work at Microsoft are amazing, kind, talented individuals. This is aimed at the company's leadership, who I feel has on many occassions crushed myself and other developers under. It's a plea for help.

The source of truth for the 'open source' C#, C++, Rust, and other Windows SDKs is proprietary

You probably haven't heard of it before, but if you've ever used win32 API bindings in C#, C++, Rust, or other languages, odds are they were generated from a repository called microsoft/win32metadata.