Skip to content

Instantly share code, notes, and snippets.

View ptts's full-sized avatar
🏠
Working from home

Patrick ptts

🏠
Working from home
View GitHub Profile
@JeffreyWay
JeffreyWay / demo.html
Created June 29, 2020 14:08
Alpine.js Transition demo
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Alpine Examples</title>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js"
defer
></script>
@ivanionut
ivanionut / nginx-proxy.conf
Created June 3, 2020 14:26 — forked from fhferreira/nginx-proxy.conf
Proxy nginx to use Google Tag Manager
# Google Analytics Bypassing Adblockers
## Client
change www.googletagmanager.com => your.domain.com
```
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://your.domain.com/gtag/js?id=UA-123456789-1"></script>
```
@NickHatBoecker
NickHatBoecker / move-wordpress.sh
Last active December 21, 2020 10:26
Moving Wordpress: Update SQL Statements
#!/bin/bash
#
# This script is used to update database url entries for wordpress.
#
# © Nick Böcker <https://nick-hat-boecker.de> 2019
# User input mysql username
read -p "Enter mySQL username [root]: " USER
USER=${USER:-root}
@berend
berend / versioning.py
Last active August 27, 2023 21:45
Versioning with flask blueprint
from flask import Blueprint
from flask import Flask
app = Flask(__name__)
v1 = Blueprint("version1", "version1")
v2 = Blueprint('version2', "version2")
@praveen-palanisamy
praveen-palanisamy / wp-backup-script.sh
Created August 19, 2018 16:25
WordPress backup script: A bash script to compress and backup a complete wordpress site including the database
#!/usr/bin/env bash
# wp-backup-script.sh - Creates a complete, compressed backup of your WordPress database and files. You can then transfer it to your preferred location (local disk, cloud backup storage etc)
# Author: Praveen Palanisamy | Twitter: @PraveenPsamy | GitHub: https://github.com/praveen-palanisamy| Website: https://praveenp.com
# Dependencies: mailutils
# 0. Change the variables below to suit your environment
WP_FOLDER="$HOME/public_html/" # Folder where your wordpress root installation is
BACKUP_FOLDER="$HOME/backups" # Folder where you want to store the backups
@Ocramius
Ocramius / Caddyfile
Last active March 11, 2024 22:14
Example docker + docker-compose + caddy + traefik setup that routes to multiple apps from one exposed HTTP port
:80 {
root /serve
}
@lifehome
lifehome / README.md
Last active February 25, 2024 06:34 — forked from benkulbertis/cloudflare-update-record.sh
Cloudflare API v4 Dynamic DNS Update in Bash

Cloudflare DDNS bash client with systemd

This is a bash script to act as a Cloudflare DDNS client, useful replacement for ddclient.

Look out!

A newer version is available!

This gist will no longer update, instead please go to https://github.com/lifehome/systemd-cfddns for more updated versions.

How to use?

  1. Put the cfupdater files to /usr/local/bin
  • If you are using IPv4 for A record, append -v4 to cfupdater in the following systemd service unit.
@cweinberger
cweinberger / mysql-drop-all-tables.sh
Created June 6, 2018 12:44
drops all tables of a specific db
#!/bin/bash
#usage: mysql-drop-all-tables -d database -u dbuser -p dbpass
TEMP_FILE_PATH='./drop_all_tables.sql'
while getopts d:u:p: option
do
case "${option}"
in
@pmkay
pmkay / top-brew-packages.txt
Last active November 18, 2024 12:55 — forked from r5v9/top-brew-packages.txt
Top homebrew packages
node: Platform built on V8 to build network applications
git: Distributed revision control system
wget: Internet file retriever
yarn: JavaScript package manager
python3: Interpreted, interactive, object-oriented programming language
coreutils: GNU File, Shell, and Text utilities
pkg-config: Manage compile and link flags for libraries
chromedriver: Tool for automated testing of webapps across many browsers
awscli: Official Amazon AWS command-line interface
automake: Tool for generating GNU Standards-compliant Makefiles
@Dreamacro
Dreamacro / ACMESH.md
Last active May 14, 2023 17:37
acme.sh docker-compose

How to use

$ docker-compose -f acmesh.yaml up -d
# Run once
$ docker exec -it acme --issue --dns dns_cf \
    -d \*.example.com \
    --key-file /certs/privkey.pem \
    --fullchain-file /certs/fullchain.pem \
 --standalone