Skip to content

Instantly share code, notes, and snippets.

View sairam4123's full-sized avatar
👨‍💻
Working on a fun project in Godot 4.2

Sairam M sairam4123

👨‍💻
Working on a fun project in Godot 4.2
View GitHub Profile
@sairam4123
sairam4123 / data_gen.py
Created September 30, 2024 04:52
Just trying out random stuff to build.. (bored)
import random
import pandas
names = []
with open("names_list.txt") as f:
for line in f.readlines():
line = line.strip()
idx, first, last = line.split(" ")
line = f"{first} {last}"
names.append(line)
@me2beats
me2beats / main.gd
Created October 7, 2020 07:28
Godot Engine GDScript snake2camel, snake2pascal, camel2snake, pascal2snake
func snake2camel(string:String)->String:
var result = PoolStringArray()
var prev_is_underscore = false
for ch in string:
if ch=='_':
prev_is_underscore = true
else:
if prev_is_underscore:
result.append(ch.to_upper())
@NovemberDev
NovemberDev / godot_async_scene_loader.gd
Last active February 10, 2024 22:57
Asynchronously loads scenes in godot
# Loads a scene in the background using a seperate thread and a queue.
# Foreach new scene there will be an instance of ResourceInteractiveLoader
# that will raise an on_scene_loaded event once the scene has been loaded.
# Hooking the on_progress event will give you the current progress of any
# scene that is being processed in realtime. The loader also uses caching
# to avoid duplicate loading of scenes and it will prevent loading the
# same scene multiple times concurrently.
#
# Sample usage:
#
@ikem-krueger
ikem-krueger / c_sharp_for_python.md
Last active March 8, 2024 02:45 — forked from mrkline/c_sharp_for_python.md
An intro to C# for a Python developer. Made for one of my coworkers.

C# For Python Programmers

Syntax and core concepts

Basic Syntax

  • Single-line comments are started with //. Multi-line comments are started with /* and ended with */.

  • C# uses braces ({ and }) instead of indentation to organize code into blocks. If a block is a single line, the braces can be omitted. For example,

@simmsb
simmsb / eval.py
Last active January 30, 2024 05:39
A good eval for discord.py
import ast
import discord
from discord.ext import commands
def insert_returns(body):
# insert return stmt if the last expression is a expression statement
if isinstance(body[-1], ast.Expr):
body[-1] = ast.Return(body[-1].value)
@Nomane
Nomane / bump-version.sh
Last active January 15, 2024 02:49
Bump version shell script.
#!/bin/bash
# Thanks goes to @pete-otaqui for the initial gist:
# https://gist.github.com/pete-otaqui/4188238
#
# Original version modified by Marek Suscak
#
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3" or even "1.2.3-beta+001.ab"
@Ryonez
Ryonez / (Unofficial) Discord server rules suggestions list.md
Last active October 26, 2024 04:29
(Unofficial) Discord server rules suggestions list

Discord

(Unofficial) Discord server rules suggestions list

Author's Note

I'll start off with letting you know this is a fork from someone else. However, for some bizarre reason, this is the one everyone finds, so I better get round to updating this. Credit to Cristiano#2233 for the original idea.

Also, I've had a lot of people saying the rules are to strict. If you pick all the rules here, you're right, it would be very strict. However the rules below are guidelines! They are there for you to pick the ones you desire, you can ignore ones you don't want. Hopefully they might help with rules you wouldn't have thought of otherwise.

@xoppa
xoppa / outline.fragment.glsl
Created October 12, 2015 20:42
very basic outline shader
#ifdef GL_ES
#define LOWP lowp
precision mediump float;
#else
#define LOWP
#endif
const float offset = 1.0 / 128.0;
varying vec2 v_texCoords;
uniform sampler2D u_texture;
@mrkline
mrkline / c_sharp_for_python.md
Last active September 2, 2024 15:51
An intro to C# for a Python developer. Made for one of my coworkers.

C# For Python Programmers

Syntax and core concepts

Basic Syntax

  • Single-line comments are started with //. Multi-line comments are started with /* and ended with */.

  • C# uses braces ({ and }) instead of indentation to organize code into blocks. If a block is a single line, the braces can be omitted. For example,