Skip to content

Instantly share code, notes, and snippets.

View Atlas48's full-sized avatar

Atlas Cove Atlas48

  • @kompot-studios
  • Sainte-Marguerite D'Elle, France
View GitHub Profile
@Atlas48
Atlas48 / rc_json2cfg.py
Created May 19, 2023 14:01
converts a json config dump from rclone, into the ini format used to store config data
# rc_json2cfg.py v1
# WTFPL v2+ (It's simple enough that you could probably write it yourself.)
# converts a json config dump from rclone, into the ini format used to store config data
from json import load as json_load
try:
with open("rclonecfg.json", 'r') as f:
o=json_load(f)
except FileNotFoundError:
print("rclonecfg.json not found, edit file and try again.")
@Atlas48
Atlas48 / op_func.py
Last active September 18, 2022 11:06
a bunch of python operators as functions; and then some
# a bunch of python operators as functions; and then some.
def add(x,y):
return x+y
def sub(x,y):
return x-y
def mul(x,y):
return x*y
def div(x,y):
return x/y
def pow(x,y):
@Atlas48
Atlas48 / gp.awk
Last active September 18, 2022 11:38
Generates a svg pallete based on a textual list of colours
#!/usr/bin/awk -f
# gp.awk: generates a svg rendering of a textual pallete list
BEGIN {
if(!h) h=1080
if(!w) w=1920
c=0
print "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"
printf("<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"%d\" width=\"%d\">\n", h, w)
}
{
@Atlas48
Atlas48 / array-fl.js
Created March 24, 2021 23:12
Adds access to first and last elements of an array.
Object.defineProperty(Array.prototype, 'last', {get:function(){return this[this.length-1];}})
Object.defineProperty(Array.prototype, 'first', {get:function(){return this[0];}})
@Atlas48
Atlas48 / Default.txt
Created July 18, 2020 18:22
Zim Wiki Default Templates
======= [% page.basename %] =======
[% gettext("Created") %] [% strftime("%A %d %B %Y") %]
(import [sys [argv]])
(import [sys.stdout [write :as eprint]])
(import [os.path [basename]])
(try
(import toml)
(except ImportError
(eprint "looks like toml wasn't found")))
(setv map {:InternetShortcut :URL (get 1 argv)})
@Atlas48
Atlas48 / amacros.h
Created February 8, 2020 12:20
bunch of nifty macros
#define true 1
#define false 0
#define eprintf fprintf(sterr, __VA_ARGS__)
@Atlas48
Atlas48 / FungusTrigger.cs
Created June 9, 2019 21:01
Handy fungus trigger.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Fungus;
public class FungusTrigger : MonoBehaviour {
//public Flowchart fc;
public bool ready = false;
public string ToCall;
private bool inProxim;
@Atlas48
Atlas48 / legacy.css
Created April 15, 2019 18:12
Reimplemetation of deprecated HTML tags as CSS classes
.marquee {
width: 450px;
margin: 0 auto;
white-space: nowrap;
overflow: hidden;
box-sizing: border-box;
}
.marquee span {
display: inline-block;
@Atlas48
Atlas48 / dwarf-fortress-ubuntu-installation-instructions.sh
Last active June 20, 2020 04:17 — forked from kzar/dwarf-fortress-ubuntu-installation-instructions.sh
Dwarf Fortress Linux (Ubuntu 15.04) installation instructions. (Nice graphics but no other crap!)
# Install a bunch of dependencies (Might not be everything, sorry!)
sudo apt-get install libsdl1.2debian:i386 libsdl-image1.2:i386\
libsdl-ttf2.0-0:i386 libglu1-mesa:i386 libgtk2.0-0:i386\
libopenal1:i386 libjpeg62:i386 git tar unzip bzip2
# Fetch Dwarf fortress itself (See http://www.bay12games.com/dwarves/ )
mkdir dwarf-fortress && cd dwarf-fortress
wget -o - http://www.bay12games.com/dwarves/df_42_06_linux.tar.bz2 | tar xvjf -
# Install Phoebus graphics pack (See http://www.bay12forums.com/smf/index.php?topic=137096.0 )