Skip to content

Instantly share code, notes, and snippets.

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

Berthold Fritz codingbychanche

🏠
Working from home
  • Germany
View GitHub Profile
@codingbychanche
codingbychanche / gist:39717b989229ec199beadee19f551b5c
Created October 19, 2023 16:42
Calculates the distance between two given coordinates.....
10 REM CALCULATES THE DISTANCE
11 REM BETWEEN TWO GIVEN
12 REM COORDINATES.
13 REM
14 REM LAT- // LONGTITUTE
20 M=53.48:K=2.24
30 N=35.65:L=-139.83
40 R=6372.8:P=3.1452:D=P/180
50 A=SIN((L-K)*D/2):A=A*A
60 B=COS(M*D)*COS(N*D):C=SIN((N-M)*D/2)
@codingbychanche
codingbychanche / AtariBasicPatcher.asm
Created October 16, 2022 08:20
Shows how Atari Basic can be copied from ROM to RAM... Credits: https://goto10.substack.com/p/change-the-atari-basic-ready-prompt. This is my version of the code from the link mentioned.
; Copys Basic from ROM into RAM.
;
; Allows one to change Atari Basic, e.g. change ready prompt etc.
;
; Initial idea: https://goto10.substack.com/p/change-the-atari-basic-ready-prompt
;
; B.Fritz 10/2022
; ---------------------------------------------------------------------------------
; Some addresses to play with:
; Ready promt starts at: 48499
@codingbychanche
codingbychanche / collision.monkeyx
Last active April 9, 2022 09:00
A collection of collision detection algorithms. Written in "MonkeyX". Easily portable to any other language :-)
'************************************************************************************************
' Collision detection
'
' This class checks if a given set of coordinates overlaps with a given area
' It retruns 'true' if the areas/ coordinates do overlap and 'false' if they do not
'
' 01.04.2015 Fixed 'circ_with_circ'
' 27.12.2015 Added 'rect_in_rect'
'
'************************************************************************************************
@codingbychanche
codingbychanche / Generic info activity for Android
Last active June 2, 2021 10:59
Generic info activity for Android app's. Shows how to get your app's version tag- name from the associated- gradle file. Shows how to check if a new version of this app is available at Google Play Store.
Asociated library's (include into yout build- gradle)
// jsoup HTML parser library @ https://jsoup.org/
implementation 'org.jsoup:jsoup:1.13.1'
Layout:
<?xml version="1.0" encoding="utf-8"?>
@codingbychanche
codingbychanche / FragmentCustomDialogYesNo.java
Last active December 8, 2020 10:26
Android. Code snipplets ready to use....
/*
* FragmentCustomDialogYesNo.java
*
* Created by Berthold Fritz
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-nc-sa/4.0/
*
* Last modified 9/5/18 5:03 PM
*/
# This checks for a string in a file
search='sawfish'
file='maze.atr'
if [ $(strings $file | grep -i $search) ]
then
echo $search found in file $file
else
echo $search not found in file $file !
/*------------------------------------------------------------------------------------
* C- Source.c
* A standard framework for C- Language command line tools
*
*
*
* V0.0 // 30.10.2014
*------------------------------------------------------------------------------------*/
#include <stdio.h>
@codingbychanche
codingbychanche / MADS does *.ATR
Last active April 24, 2018 17:35
6502 Assembler
; Build *.ATR
;
; This program shows how one can compile 6502 source into
; a valid *.ATR image file ( => an bootable disk Image for Atari 8- Bit computers)
; using the MADS Assembler. You can use it as a framework for your own projects.
;
; Why?
;
; I was asking myself, how one could start *.XEX image files on the real machine.
; *.XEX files are Atari DOS 2.x compatible binary files. Since the SIO2USB