Skip to content

Instantly share code, notes, and snippets.

View bardic's full-sized avatar

TJ bardic

View GitHub Profile
@bardic
bardic / test.go
Last active December 14, 2024 16:17
dagger ijhttp example
func (i *Integration) Test(server, test *dagger.Directory) (string, error) {
serverService := dag.Container().
From("golang:latest").
WithDirectory("/src", server).
WithExposedPort(1323).
WithWorkdir("/src/server").
WithExec([]string{"go", "run", "main.go"}).
AsService()
@bardic
bardic / gist:9a12f5276166452e22406d54fbee0837
Last active December 8, 2024 08:08
GameCI with MSBuild Env
# Based on https://learn.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2022#create-and-build-the-dockerfile
# and
# https://game.ci/docs/docker/customize-docker-images
# escape=`
FROM unityci/editor:windows-6000.0.30f1-windows-il2cpp-3.1.0
SHELL ["cmd", "/S", "/C"]
package main
import (
"embed"
"fmt"
"io/fs"
)
//tmpl contains 3 empty files for example; 1,2,3
@bardic
bardic / create_certs.sh
Created August 12, 2023 18:40
How I use docker and a simple shell script to renew my ssl certs. Nginx docker and site.conf example of how certs are processed and saved
#!/bin/bash
docker-compose -f ../certbot/docker-compose.yml --env-file ../certbot/openbracket.ca.env up
docker-compose -f ../certbot/docker-compose.yml --env-file ../certbot/pass.openbracket.ca.env up
docker-compose -f ../certbot/docker-compose.yml --env-file ../certbot/social.openbracket.ca.env up
docker-compose -f ../certbot/docker-compose.yml --env-file ../certbot/git.openbracket.ca.env up
docker-compose -f ../certbot/docker-compose.yml --env-file ../certbot/design.openbracket.ca.env up
@bardic
bardic / tidy.sh
Created August 12, 2023 18:18
Simple shell script to loop through your go.work and tidy the known modules
#!/bin/sh
ROOT=`pwd`
while read p; do
all=$(echo $p)
first=${all%% *}
if [[ $first == "use" ]]; then
last=${all##* }
cd $last
@bardic
bardic / run.sh
Created May 22, 2023 17:33
Example of how I use jq to parse some json for script commands and details
#!/bin/sh
############
#
# Functions
#
###########
function exit_with_help {
echo \
router
.get('/cat', (ctx, next) => {
ctx.body = "Hello"
r.table('authors').run(connection, function(err, cursor) {
if (err) throw err;
cursor.toArray(function(err, result) {
if (err) throw err
console.log(ctx)
//THIS PART DOESN'T WORK
ctx.body += result[0].name
#!/bin/bash
for f in ./posts/*.md;do
echo "Processing $f file..."
IFS='/' read -r -a array <<< "$f"
# take ~action on each file. $f store current file name
echo ${array[2]}
FNAME=${array[2]}
CLEANNAME=${FNAME:0:9}
echo "cat $CLEANNAME"
mkdir "./posts/$CLEANNAME"
npm_new_phaser() {
if [ "$1" != "" ]
then
mkdir "$1"
cd "$1"
if ! type nvm > /dev/null; then
echo "Insatll NVM. I'm not doing it for you since you need shell integration"
echo "https://github.com/creationix/nvm"
return 1
npm_new() {
if [ "$1" != "" ]
then
mkdir "$1"
cd "$1"
if ! type nvm > /dev/null; then
echo "Insatll NVM. I'm not doing it for you since you need shell integration"
echo "https://github.com/creationix/nvm"
return 1