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 / Python_Go_Bridge_v1
Created October 17, 2020 14:17
Make Python faster by using GO as efficiently as possible with minimal effort. (with a bit of RUST).
Problem Statement:
Use Go to augment the processing power of Python.
Solutions:
(1) Call GO from Python:
This can be done but it is a bit tedious as shown below:
@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) {
@artman41
artman41 / wsl-install_another_distro.md
Last active July 20, 2024 06:37
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 / 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
@SeanSobey
SeanSobey / portainer.md
Last active June 12, 2024 07:40
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:

@byk0t
byk0t / smartsvn-unity-launcher.txt
Created December 23, 2016 12:14
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
@sysulq
sysulq / main.go
Last active December 19, 2023 07:50
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) {
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -xvzf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194/
./configure --prefix=/usr/local
make
make install
@benallard
benallard / xml_split.py
Last active March 5, 2024 05:28
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