Skip to content

Instantly share code, notes, and snippets.

View digitalfun's full-sized avatar

Florian Schmid @github digitalfun

  • Switzerland
View GitHub Profile
@digitalfun
digitalfun / Create backup of XXX.bat
Created May 28, 2024 13:51
[Batch] Create backup copy with datetime
@ECHO OFF
REM support "Umlaute äöü" (Use codepage CP-1252 aka "Windows-1252" aka "Latin 1")
CHCP 1252 >nul
TITLE Create backup of XXX
SET "$PS_EXE=powershell.exe"
SET "_SOURCE_FILENAME=xxx.xlsx"
SET "_TARGET_BACKUP_FOLDER=X:\abc\def\geh\backup"
@digitalfun
digitalfun / post.js
Created May 15, 2024 08:51 — forked from AlphaT7/post.js
PHP POST JSON JavaScript Fetch Example 1
fetch("post.php", {
method: "post",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: {data: "data"}
})
.then(response => {
return response.text(); // returns text that can used as html
@digitalfun
digitalfun / touch.bat
Last active December 13, 2022 09:12
[Batch] Touch.bat
REM Update date/timestamp of file in positional argument 1.
REM Syntax: `touch.bat <filename>`
REM Example: `touch.bat "C:\any path\my file.ext"`
@COPY /B %1+,, %1
@digitalfun
digitalfun / 55-bytes-of-css.md
Created September 26, 2022 09:33 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@digitalfun
digitalfun / [Autohotkey] app-helper-template.ahk
Created December 18, 2017 14:51
Autohotkey App-helper script template
/*md
- File: filename.ahk; Type: Autohotkey script
- AHK Version: 1.0.0
- Author:
- Copyright:
- Notes:
*/
MYVERSION=1.0.0
@digitalfun
digitalfun / [Taskfile.bat] task-add-task.bat
Last active November 8, 2017 14:33
Taskfile.bat script: Appends a file to Taskfile.bat (used to "install" tasks)
:task-add-task <filename>: Adds/appends a task from a file to Taskfile.bat
IF "%1"=="add-task0" (
ECHO Missing argument ^<filename^>
GOTO :EOF
)
TYPE "%1" >>%scriptName%
ECHO. >>%scriptName%
GOTO :EOF
@digitalfun
digitalfun / [Taskfile-bat] task-code-folder.bat
Last active November 8, 2017 14:33
Taskfile.bat script: Open project folder with Microsoft Visual Code
@REM Taskfile.bat example task for opening a project folder with Visual Code
:task-projectX: Open ProjectX folder in code
ECHO open ProjectX folder
SET taskProjectFolder = "C:\Projects\ProjectX\"
CALL code %taskProjectFolder%
GOTO :EOF
@digitalfun
digitalfun / [Taskfile-bat] run.bat or task.bat
Created August 31, 2017 08:30
Taskfile-bat script. This is an alias for "Taskfile.bat", coz we are lazy coderz.
@Taskfile.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
@digitalfun
digitalfun / [Taskfile-bat] run-init.bat (download, curl)
Last active November 17, 2017 16:32
Taskfile-bat script to initialize Taskfile-bat in your project. (This requires CURL and will download the template from github)
@curl -so Taskfile.bat https://gist.githubusercontent.com/digitalfun/da780fdb2cc6262febe854e451e13d55/raw/b0214216858a9e68583bf043a7db0611b40f838a/%255BTaskfile-bat%255D%2520Taskfile.template.bat
@ECHO Taskfile initialized.
@ECHO Usage: Taskfile.bat ^<task^> ^<args^>
@digitalfun
digitalfun / [Taskfile-bat] run-init.bat (copy)
Created August 31, 2017 08:21
Taskfile-bat script to initialize Taskfile-bat in a new project.
@COPY "%~dp0Taskfile.template.bat" "Taskfile.bat"
@ECHO Taskfile initialized.
@ECHO Usage: Taskfile.bat ^<task^> ^<args^>