This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
query="Final%20Fantasy" | |
user_agent='user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36' | |
results=$(curl "https://www.metacritic.com/search/$query/?page=1&category=3" -H "$user_agent" | htmlq 'div.c-pageSiteSearch-results a' -a href | xargs printf "https://www.metacritic.com%s\n" % '_') | |
item () { | |
name="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# #!/usr/bin/env bash | |
# Based on https://gist.github.com/chillpert/1a76ae8e9cfafb36d3bf9e343d32fedc | |
# Expand ue4cli | |
ue() { | |
ue4cli=$(which ue4) | |
engine_path=$($ue4cli root) | |
UPROJECT_PATH=$(realpath $(find . -name *.uproject)) | |
DEBUG_BINARY_PATH="/Users/Shared/Epic Games/UE_5.3/Engine/Binaries/Mac/UnrealEditor-Mac-DebugGame.app/Contents/MacOS/UnrealEditor-Mac-DebugGame" | |
project_name=$(basename "$UPROJECT_PATH" | sed 's/.uproject//') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta | |
from pydantic import BaseModel, Field, validator, ValidationError | |
# Random json data or something | |
person_json = { | |
"name": "John Doe", | |
"age": 30, | |
"address": { | |
"street": "Main Street", | |
"city": "New York", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
git pull | |
ver=$(git describe --tags --abbrev=0 | sed 's/-/_/g') | |
echo "Version is $ver" | |
update () { | |
sed -i "s/^pkgver.\+\$/pkgver=$ver/g" PKGBUILD | |
git remote set-url origin "$(git remote get-url origin | sed 's#^https://#ssh://aur@#')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import subprocess | |
from os import system | |
import re | |
from dataclasses import dataclass | |
from datetime import datetime | |
from collections import Counter | |
LOGFILE = "/var/log/apache2/live-access_log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Way to compute pi in common lisp using Leibniz formula | |
(defun ^ (x n) | |
(if (> n 0) | |
(* x (^ x (- n 1))) | |
(if (< n 0) | |
(* (/ 1 x) (^ x (+ n 1))) | |
1))) | |
(defun oddnum (n) (+ (* 2 n) 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# YPTSOCKET | |
TOP=20 | |
YPTSOCKET=/var/www/html/AVideo/plugin/YPTSocket/server.php | |
MAXCPU=80.0 | |
CPUSERVICE=ytsocket.service | |
# APACHE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import "package:irc/client.dart"; | |
import "dart:io"; | |
// This stores our configuration for this client | |
var config = Configuration( | |
host: "irc.dot.org.es", | |
port: 6697, | |
ssl: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"os" | |
"bufio" | |
"fmt" | |
"log" | |
"net" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Proof or work | |
const difficulty = 3 | |
async function sha256(message) { | |
const msgBuffer = new TextEncoder().encode(message); | |
const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer); | |
const hashArray = Array.from(new Uint8Array(hashBuffer)); | |
const hashHex = hashArray.map(b => b.toString(16).padStart(2, '0')).join(''); | |
return hashHex; | |
} |
NewerOlder