Skip to content

Instantly share code, notes, and snippets.

View jmcmullen's full-sized avatar
🇦🇺

Jay McMullen jmcmullen

🇦🇺
  • Qantas
  • Sydney, Australia
View GitHub Profile
@jmcmullen
jmcmullen / countries.json
Created September 18, 2023 16:23
A list of countries with name, country code, calling codes and flags as emoji.
{
"AF": {
"currency": [
"AFN"
],
"callingCode": [
"93"
],
"name": "Afghanistan",
"emoji": "🇦🇫"
@jmcmullen
jmcmullen / Progress.tsx
Created November 25, 2022 14:55
Next 13 appDir NProgress Bar
"use client";
import { useEffect } from "react";
import NProgress from "nprogress";
type PushStateInput = [
data: any,
unused: string,
url?: string | URL | null | undefined
];
#!/bin/bash
if [[ -z "$NGROK_TOKEN" ]]; then
echo "Please set 'NGROK_TOKEN'"
exit 2
fi
if [[ -z "$USER_PASS" ]]; then
echo "Please set 'USER_PASS' for user: $USER"
<template>
<div>
<button
class="border-2 p-1 rounded-full flex justify-start border-white items-center cursor-pointer w-15 focus:outline-none focus:border-teal-100 transition-switch"
:class="buttonStyles"
@click="onChange"
@keydown.enter="onChange"
>
<span
class="rounded-full border-2 w-6 h-6 shadow-inner border-white bg-white shadow border-4 transition-all transition-duration-300 ease-in-out"
import { useState, useEffect } from 'react';
function useDebounce<T>(
initialValue: T,
time: number
): [T, T, React.Dispatch<T>] {
const [value, setValue] = useState<T>(initialValue);
const [debouncedValue, setDebouncedValue] = useState<T>(initialValue);
useEffect(() => {
http://www.libimobiledevice.org
On macOS:
brew install libimobiledevice
## to disable iCloud backups
idevicebackup2 cloud off
## if you want encrypted backups (native encryption)
idevicebackup2 encryption on -i
Set WshShell = WScript.CreateObject("WScript.Shell")
Comandline = "C:\Users\Jay\AppData\Roaming\Spotify\Spotify.exe"
WScript.sleep 500
CreateObject("WScript.Shell").Run("spotify:user:21exgkdi3qaoc23wvwlbpikza:playlist:7u1cfxjN5qhgyrx5wtT6zF")
WScript.sleep 3000
WshShell.SendKeys " "
### 1: Drop invalid packets ###
/sbin/iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP
### 2: Drop TCP packets that are new and are not SYN ###
/sbin/iptables -t mangle -A PREROUTING -p tcp ! --syn -m conntrack --ctstate NEW -j DROP
### 3: Drop SYN packets with suspicious MSS value ###
/sbin/iptables -t mangle -A PREROUTING -p tcp -m conntrack --ctstate NEW -m tcpmss ! --mss 536:65535 -j DROP
### 4: Block packets with bogus TCP flags ###
C24ED7F5D2FBC94D35ADB2AD2E1122
@jmcmullen
jmcmullen / FakeUserAgent.js
Last active December 8, 2019 13:00
eval.toString().length gives you different length for each browser.
function fakeUserAgent() {
var t, e = navigator.userAgent.toLowerCase(),
n = navigator.productSub;
if (("Chrome" === (t = e.indexOf("firefox") >= 0 ? "Firefox" : e.indexOf("opera") >= 0 || e.indexOf("opr") >= 0 ? "Opera" : e.indexOf("chrome") >= 0 ? "Chrome" : e.indexOf("safari") >= 0 ? "Safari" : e.indexOf("trident") >= 0 ? "Internet Explorer" : "Other") || "Safari" === t || "Opera" === t) && "20030107" !== n)
return !0;
var r, i = eval.toString().length;
if (37 === i && "Safari" !== t && "Firefox" !== t && "Other" !== t)
return !0;
if (39 === i && "Internet Explorer" !== t && "Other" !== t)
return !0;