Skip to content

Instantly share code, notes, and snippets.

View masterxavierfox's full-sized avatar
✌️

Xavier Fox masterxavierfox

✌️
View GitHub Profile
Understand the Task: Grasp the main objective, goals, requirements, constraints, and expected output.
- Minimal Changes: If an existing prompt is provided, improve it only if it's simple. For complex prompts, enhance clarity and add missing elements without altering the original structure.
- Reasoning Before Conclusions: Encourage reasoning steps before any conclusions are reached. ATTENTION! If the user provides examples where the reasoning happens afterward, REVERSE the order! NEVER START EXAMPLES WITH CONCLUSIONS!
- Reasoning Order: Call out reasoning portions of the prompt and conclusion parts (specific fields by name). For each, determine the ORDER in which this is done, and whether it needs to be reversed.
- Conclusion, classifications, or results should ALWAYS appear last.
- Examples: Include high-quality examples if helpful, using placeholders [in brackets] for complex elements.
- What kinds of examples may need to be included, how many, and whether they are complex enough to benefit from p
@masterxavierfox
masterxavierfox / Makefile
Created July 5, 2022 16:16 — forked from thomaspoignant/Makefile
My ultimate Makefile for Golang Projects
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=example
VERSION?=0.0.0
SERVICE_PORT?=3000
DOCKER_REGISTRY?= #if set it should finished by /
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
GREEN := $(shell tput -Txterm setaf 2)
@masterxavierfox
masterxavierfox / k8s-patch.go
Created February 4, 2022 19:54 — forked from dwmkerr/k8s-patch.go
Example showing how to patch Kubernetes resources in Golang. Companion to the article 'https://dwmkerr.com/patching-kubernetes-resources-in-golang/'.
// Example showing how to patch kubernetes resources.
// This is the companion to my article 'Patching Kubernetes Resources in Golang':
// https://dwmkerr.com/patching-kubernetes-resources-in-golang/
package main
import (
"encoding/json"
"fmt"
types "k8s.io/apimachinery/pkg/types"
@masterxavierfox
masterxavierfox / k8s-svc-annotations.md
Created August 13, 2020 09:16 — forked from mgoodness/k8s-svc-annotations.md
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
@masterxavierfox
masterxavierfox / .dockerignore - backend
Last active May 25, 2020 18:19
Dockerfiles and compose
PGDATA
node_modules
npm-debug.log
.dockerignore
Dockerfile
<source>
@type tail
<parse>
@type none
</parse>
format none
path /var/log/$apppath1/*
tag $application name 1
hostname $hostname
</source>
#!/bin/bash
#
# Copyright 2011, Tim Branyen @tbranyen <tim@tabdeveloper.com>
# Dual licensed under the MIT and GPL licenses.
#
# Automatically clone single or multiple repos into a folder,
# great for setting up a git projects folder.
#
# Install: curl https://gist.github.com/raw/902154/github.sh > /usr/local/bin/gh
# chmod +x /usr/local/bin/gh
@masterxavierfox
masterxavierfox / custom-emby.css
Created August 30, 2019 10:28
Emby Custom css
.pageTitleWithDefaultLogo {
display: none;
}
@masterxavierfox
masterxavierfox / s3master.go
Created May 29, 2019 07:42
Golang : Upload and download file to/from AWS S3
//https://socketloop.com/tutorials/golang-upload-and-download-file-to-from-aws-s3
package main
import (
"bufio"
"fmt"
"io"
"launchpad.net/goamz/aws"
"launchpad.net/goamz/s3"
"net/http"
#!/bin/bash
function upload_day {
table=$1
sel=$2
day=$3
next_day=$(date -d "$day+1 days" +%Y-%m-%d)
bq_suffix=$(date -d "$day" +%Y%m%d)
echo "Uploading $table: $day..."
psql <yourdbname> -c "\\copy (select $sel from $table where created_at >= '$day' and created_at < '$next_day') TO '$table-$day.csv' WITH CSV HEADER"
gzip $table-$day.csv