Skip to content

Instantly share code, notes, and snippets.

View larrasket's full-sized avatar

larrasket

View GitHub Profile
@larrasket
larrasket / Download PDFs from Quran Explorer or Quran Archive.org
Last active January 20, 2023 00:20
Download PDFs from Quran Explorer/Quran Archive
@larrasket
larrasket / toggle-internet-keep-network.sh
Created February 24, 2023 12:58
Toggle internet connection but keep network
#!/bin/bash
# Check if the internet connection is currently active
ping -q -c 1 -W 1 google.com > /dev/null
if [ $? -eq 0 ]
then
# If the internet connection is active, turn it off by removing the default gateway
echo "Turning off internet connection"
sudo ip route del default
else
@larrasket
larrasket / setcookie.go
Created April 15, 2024 14:57 — forked from NaniteFactory/setcookie.go
chromedp set-cookie example
package main
import (
"context"
"fmt"
"log"
"time"
"github.com/chromedp/cdproto/cdp"
"github.com/chromedp/cdproto/network"
@larrasket
larrasket / lispmode.jl
Created July 6, 2024 10:59 — forked from brenhinkeller/lispmode.jl
Bare-bones REPL for Julia's secret built-in s-expression syntax, in under 30 lines
to_expr(x) = x
to_expr(t::Tuple) = Expr(to_expr.(t)...) # Recursive to_expr implementation courtesy of Mason Protter
lisparse(x) = to_expr(eval(Meta.parse(x))) # Note that the `eval` in here means that any normal (non-s-expression) Julia syntax gets treated a bit like a preprocessor macro: evaluated _before_ the s-expression syntax is compiled and evaluated
function lispmode()
# READ
printstyled("\nlisp> ", color=:magenta, bold=true)
l = readline()
while l !== "(:exit)"
try # So we don't get thrown out of the mode
# EVAL