Skip to content

Instantly share code, notes, and snippets.

View timlg07's full-sized avatar

Tim Greller timlg07

View GitHub Profile
@timlg07
timlg07 / TicTacToe.cmd
Created December 24, 2020 12:26
The Tic Tac Toe game implemented as Batch script.
@echo off
setlocal enabledelayedexpansion
title tic tac toe
:init
set "options="
set "players=XO"
set /a rounds = 0
set "separator=+-----------+"
@timlg07
timlg07 / .gitignore
Created January 25, 2021 16:57
Gitignore for eclipse gradle projects.
# compiled class files
*.class
# log files
*.log
# package files
*.jar
*.war
*.nar
@echo off & setlocal & goto main
:hextoint %1:string
set "remainingHexString=%~1"
set /a position = 0
set /a base = 16
set /a result = 0
set "hexCharValueMap=(a:10,b:11,c:12,d:13,e:14,f:15)"
:_hextoint
@echo off
setlocal enableDelayedExpansion
title Batch Game Demo
set /a width = 20, height = 15
set /a windowWidth = width + 1 + (2 * 2)
set /a windowHeight = height + 6
set /a speed = 1
set /a x = width / 2, y = height / 2
.data
array: .word 13, 37, 6, 9, 420
size: .word 0
.text
main: li $t0, 0 # item index := 0
la $t1, array # array start
la $t2, size # array end
loop: sll $t3, $t0, 2 # multiply index by 4
add $t3, $t3, $t1 # add array start position
@timlg07
timlg07 / update NPM packages (major versions)
Created April 23, 2022 17:52
Batch/ Shell script to update the major versions of NPM packages of a project
npm outdated
npm install -g npm-check-updates
ncu -u
npm install
@timlg07
timlg07 / token-login.php
Last active June 18, 2023 11:49 — forked from kidino/token-login.php
Login to WordPress web with JWT
<?php
/*
JWT TOKEN LOGIN -- Automatically logs a user in a WordPress site with JWT
This script allows you to log a user into a WordPress site automatically
based on his/her JSON Web Token (JWT). This assumes that you use the
following plugin and set it up properly on your WordPress site to enable
JWT authentication via REST API.
JWT Auth – WordPress JSON Web Token Authentication
@timlg07
timlg07 / link_public.php
Created December 25, 2023 15:28
Contao on cPanel