Skip to content

Instantly share code, notes, and snippets.

View raychorn's full-sized avatar

Ray C Horn raychorn

View GitHub Profile
@raychorn
raychorn / PlayerAnimator.cs
Created October 17, 2022 23:26 — forked from Matthew-J-Spencer/PlayerAnimator.cs
Control unity animations using code. Video: https://youtu.be/ZwLekxsSY3Y
using System;
using UnityEngine;
using UnityEngine.Tilemaps;
using Random = UnityEngine.Random;
public class PlayerAnimator : MonoBehaviour {
[SerializeField] private float _minImpactForce = 20;
// Anim times can be gathered from the state itself, but
// for the simplicity of the video...
@raychorn
raychorn / decode.py
Created July 31, 2022 16:28 — forked from Chase-san/decode.py
A python script to decode the hello games no man's sky save files. (The newer compressed kind)
#!/usr/bin/python3
import io
import os
import lz4.block
from glob import glob
FILE_PATH = os.path.dirname(os.path.realpath(__file__))
def uint32(data):
"""Convert 4 bytes to a little endian unsigned integer."""
@raychorn
raychorn / docker-compose.yml
Created December 16, 2021 16:08 — forked from mjul/docker-compose.yml
Elastic Search, Logstash and Kibana via docker-compose for parsing key=value style log files
version: '2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.2
volumes:
- esdata:/usr/share/elasticsearch/data
ports:
- "9200:9200"
@raychorn
raychorn / portainer.md
Created June 23, 2021 18:15 — forked from SeanSobey/portainer.md
Portainer Setup on Windows 10

Portainer on Windows 10

Here I have 2 methods for running portainer on windows, a quick, preferred method only requiring a fairly recent version of docker, or a more complicated method to try if that does not work.

Using host.docker.internal

This setup will let you run Portainer on windows by using the host.docker.internal endpoint (docker.for.win.localhost is depricated since docker version 3.2.1, but older versions may use this instead).

Please note:

package main
import (
"crypto/aes"
"crypto/cipher"
"fmt"
"crypto/rand"
"io"
"encoding/base64"
"encoding/hex"
@raychorn
raychorn / wsl-install_another_distro.md
Created October 17, 2020 19:13 — forked from artman41/wsl-install_another_distro.md
Instructions on how to install a custom distro in WSL2 (Windows SubSystem for Linux 2)

WSL install another distro

  1. Here are some default vars for the process
ISO_DIR=~/fedora;
ROOTFS_MOUNT_DIR=/mnt/contents

DISTRO_LOCATION=
@raychorn
raychorn / main.go
Created October 14, 2020 02:40 — forked from sysulq/main.go
A simple example to call python function from golang.
package main
import (
"github.com/qiniu/py"
"log"
//"path/filepath"
"strconv"
)
func callPythonFunction(file string, function string) (int, string) {
@raychorn
raychorn / astar.py
Created October 3, 2020 13:29 — forked from jamiees2/astar.py
A* Algorithm implementation in python.
# Enter your code here. Read input from STDIN. Print output to STDOUT
class Node:
def __init__(self,value,point):
self.value = value
self.point = point
self.parent = None
self.H = 0
self.G = 0
def move_cost(self,other):
return 0 if self.value == '.' else 1
@raychorn
raychorn / smartsvn-unity-launcher.txt
Created August 23, 2018 14:53 — forked from byk0t/smartsvn-unity-launcher.txt
How to create ubuntu unitiy dash launcher for smartsvn application
1.Create desktop config file
sudo nano /usr/share/applications/smartsvn.desktop
2. Put the text below
[Desktop Entry]
Name=SmartSVN
Name[en]=SmartSVN
Name[ru]=SmartSVN
@raychorn
raychorn / xml_split.py
Created February 14, 2018 00:44 — forked from benallard/xml_split.py
Small python script to split huge XML files into parts. It takes one or two parameters. The first is always the huge XML file, and the second the size of the wished chunks in Kb (default to 1Mb) (0 spilt wherever possible) The generated files are called like the original one with an index between the filename and the extension like that: bigxml.…
#!/usr/bin/env python
import os
import xml.parsers.expat
from xml.sax.saxutils import escape
from optparse import OptionParser
from math import log10
# How much data we process at a time