Skip to content

Instantly share code, notes, and snippets.

View ultimateprogramer's full-sized avatar

Ahmed Maawy ultimateprogramer

View GitHub Profile
@ultimateprogramer
ultimateprogramer / angular_velocity.lua
Last active January 20, 2022 18:42
Linear Movement along a direction set by an angle
Movement = Class{}
function Movement:init(x, y, angle, speed)
self.position = vector(x, y)
self.angle = angle
self.speed = speed
self.velocity = self.speed * vector(math.cos(self.angle), math.sin(self.angle))
end
function Movement:update(dt)
@ultimateprogramer
ultimateprogramer / start-defold.sh
Created May 23, 2021 20:45
Start Defold with MESA Override on Ubuntu 20.04
export MESA_GL_VERSION_OVERRIDE=2.1
./Defold
@ultimateprogramer
ultimateprogramer / database.rules.json
Created February 17, 2021 17:05 — forked from codediodeio/database.rules.json
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@ultimateprogramer
ultimateprogramer / MyKinematic2D.gd
Last active January 17, 2021 12:27
GDScript Helper for Flipping Physics Objects - Godot 3
extends KinematicBody2D
const FLIP_HELPERS = preload("res://scripts/flip_helpers.gd")
func _ready()
flip_helpers = FLIP_HELPERS.new(self)
# Invoking
func do_a_flip_h(do_flip):
@ultimateprogramer
ultimateprogramer / thread-sync.py
Created January 14, 2021 10:09
Python Thread Synchronization
#!/usr/bin/python
import threading
import time
# Ref: https://www.tutorialspoint.com/synchronizing-threads-in-python
class myThread (threading.Thread):
def __init__(self, threadID, name, counter):
threading.Thread.__init__(self)
self.threadID = threadID
@ultimateprogramer
ultimateprogramer / install-kubectl-helm-ubuntu.sh
Last active November 25, 2020 16:40 — forked from onuralp/install-kubectl-helm-ubuntu.sh
This script installs kubectl kubectx and helm to you ubuntu. I usually use docker to connect kubectl. But I created this for some reason. Enjoy
# update
sudo apt-get update
sudo apt-get -qq update
# Install kubectl
sudo curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
sudo chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
# Install kubectx (Switch between Kubernetes contexts/namespaces)
@ultimateprogramer
ultimateprogramer / py-gitignore
Created October 8, 2020 09:22 — forked from MOOOWOOO/py-gitignore
python pycharm gitignore
# Created by .ignore support plugin (hsz.mobi)
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Makefile template for a shared library in C
# https://www.topbug.net/blog/2019/10/28/makefile-template-for-a-shared-library-in-c-with-explanations/
CC = gcc # C compiler
CFLAGS = -fPIC -Wall -Wextra -O2 -g # C flags
LDFLAGS = -shared # linking flags
RM = rm -f # rm command
TARGET_LIB = libtarget.so # target lib
SRCS = main.c src1.c src2.c # source files