View nginx-php-mariadb-installer-debian12.bash
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
# Update apt repositories | |
sudo apt update -y | |
sudo apt upgrade -y | |
# Install nginx & PHP | |
sudo apt install -y nginx php8.2 | |
sudo apt-get install -y php8.2-{fpm,cgi,mysql,curl,xsl,gd,common,xml,zip,xsl,soap,bcmath,mbstring,gettext,imagick,sqlite3,intl} | |
sudo nano /etc/nginx/sites-available/default | |
# Add the following / update the file to contain it: |
View git-fork-update.bash
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/bash | |
# | |
# This script keeps all Git repositories within a specified directory up to date. | |
# | |
# Consider the following example. The linux and curl repositories will be updated | |
# when you run this in the gitforks directory. | |
# | |
# gitforks/ | |
# linux/.git/ linux Git repository |
View gitlines.sh
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
git log --shortstat --author "Romein van Buren" \ | |
| egrep "file[s] changed" \ | |
| sed 's/changed, \([0-9]\+ deletions\)/changed, 0 insertions(+), \1/g' \ | |
| awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed:", files, "- lines inserted:", inserted, "- lines deleted:", deleted}' |
View meta.svelte
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
<script lang="ts"> | |
import { page } from '$app/stores'; | |
export let title: string; | |
export let description: string; | |
export let image = '/img/social/preview.jpg'; | |
export let path = $page.url.pathname; | |
export let domain = 'https://www.mysite.com'; | |
export let titleSuffix = 'My site'; |
View get-user-id.cs
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
using Microsoft.AspNetCore.Identity; | |
string UserID = User.FindFirstValue(ClaimTypes.NameIdentifier); |
View jpeg-tp-jpg.sh
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
find . -type f -name '*.jpeg' -print0 | xargs -0 rename 's/\.jpeg/\.jpg/' |
View dates.py
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 datetime | |
x = datetime.datetime.now() | |
print(x.strftime("%Y-%m-%d %H:%M:%S")) |
View wp-term-metadata.php
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
<?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); |
View wp-query-custom-taxonomy.php
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
<?php | |
$posts = get_posts( | |
array( | |
'numberposts' => 20, | |
'post_type' => 'custom_post_type', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'custom_taxonomy', | |
'field' => 'slug', | |
'terms' => array( 'termslug1', 'termslug2' ) |
NewerOlder