Skip to content

Instantly share code, notes, and snippets.

View neuralvis's full-sized avatar

Madhu Srinivasan neuralvis

View GitHub Profile
@neuralvis
neuralvis / custom_game_engines_small_study.md
Created April 6, 2023 12:57 — forked from raysan5/custom_game_engines_small_study.md
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

@neuralvis
neuralvis / revert-a-commit.md
Created October 12, 2021 22:13 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@neuralvis
neuralvis / asyncio.py
Created July 27, 2021 01:26
An example trigger function with asyncio in python
import asyncio
async def trigger(delay):
while True:
print("Triggered telemetry generation")
await asyncio.sleep(delay)
async def main(delay, duration):
task = asyncio.create_task(trigger(delay))
loop = asyncio.get_event_loop()
loop.call_later(duration, task.cancel)
try:
@neuralvis
neuralvis / ssh.md
Last active January 5, 2021 01:36
Tips and Tricks with SSH

Setting up a reverse SSH Tunnel

ssh -N -R 2210:localhost:22 username@host.com

This command can be interpreted as, create a tunnel between the remote host's port 2210 and localhost:22, where the remote host is host.com.

-R implies that the tunnel will be used from the remote side - i.e. host.com.

This command will initiate an ssh connection with reverse port forwarding option

@neuralvis
neuralvis / slurm.md
Last active March 21, 2021 20:53
Useful Commands in SLURM

Description of nodes, cores and memory

sinfo -o "%n,%N,%o,%X,%Y,%Z,%c,%m"
sinfo -o "%10n %10N %10o %10X %10Y %10Z %10c %10m %25f %10G"

Exclude a specific node

Search for a string within files in the current directory

grep -wrin "search for this text" .

Find subdirectories matching a pattern

find /your/directory -name "pattern*"

Performance of Flask, Tornado, GEvent, and their combinations

Wensheng Wang, 10/1/11

Source: http://blog.wensheng.org/2011/10/performance-of-flask-tornado-gevent-and.html

When choosing a web framework, I pretty much have eyes set on Tornado. But I heard good things about Flask and Gevent. So I tested the performance of each and combinations of the three. I chose something just a little more advanced than a "Hello World" program to write - one that use templates. Here are the codes:

1, Pure Flask (pure_flask.py)

@neuralvis
neuralvis / tornadosse.py
Created April 17, 2020 19:07 — forked from mivade/tornadosse.py
Tornado server-sent events
"""Demonstration of server-sent events with Tornado. To see the
stream, you can either point your browser to ``http://localhost:8080``
or use ``curl`` like so::
$ curl http://localhost:8080/events
"""
import signal
from tornado import web, gen
@neuralvis
neuralvis / lsb_release
Created March 20, 2020 18:21 — forked from skx/lsb_release
Simple alternative to /usr/bin/lsb_release
#!/bin/sh
#
# This is a simple alternative to /usr/bin/lsb_release which
# doesn't require python.
#
# If /etc/os-release exists then we use that to output data
# in a compatible format to the original lsb_release utility.
#
# I consider this script trivial enough to be in the public-domain,
# but any patches or suggestsions will be welcome.
@neuralvis
neuralvis / multiple_ssh_setting.md
Created November 15, 2019 22:59 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"