Skip to content

Instantly share code, notes, and snippets.

View msaroufim's full-sized avatar
🤖
Putting the finishing touches on my robot army

Mark Saroufim msaroufim

🤖
Putting the finishing touches on my robot army
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
using UnityEngine;
using System.Collections;
using System;
using System.Runtime.Serialization;
[Serializable]
public class BaseEffect {
[NonSerialized]
public Unit AttachedUnit;
[Serializable]
public class ZapEffect : BaseEffect {
private int[] _damagePerCharge = new int[] { 1, 2, 3 };
public override void Apply()
{
int multiplier = (Ability as Spell).Charges.Percentage == 1 ? 2 : 1;
int damage = _damagePerCharge[Ability.Level] * (Ability as Spell).Charges.Current * multiplier;
BattleApp.Instance.ResolveDamage(damage, BattleApp.Instance.CurrentPlayer, BattleApp.Instance.CurrentTarget, DamageType.Wind);
@ygrenzinger
ygrenzinger / CleanArchitecture.md
Last active February 25, 2026 08:40
Summary of Clean Architecture by Robert C. Martin

Summary of book "Clean Architecture" by Robert C. Martin

Uncle Bob, the well known author of Clean Code, is coming back to us with a new book called Clean Architecture which wants to take a larger view on how to create software.

Even if Clean Code is one of the major book around OOP and code design (mainly by presenting the SOLID principles), I was not totally impressed by the book.

Clean Architecture leaves me with the same feeling, even if it's pushing the development world to do better, has some good stories and present robust principles to build software.

The book is build around 34 chapters organised in chapters.

@sonots
sonots / nvvp.md
Last active February 18, 2026 17:17
How to use NVIDIA profiler

Usually, located at /usr/local/cuda/bin

Non-Visual Profiler

$ nvprof python train_mnist.py

I prefer to use --print-gpu-trace.

@Peng-YM
Peng-YM / MST.py
Last active June 18, 2021 02:06
Prim and Kruskal algorithm written in Python
# coding: utf-8
import re
# Class WeightedGraph
class WeightedGraph:
def __init__(self, path):
# open file to initialize the graph
file = open(path, "r")
p = re.compile("\d+")
@sebble
sebble / stars.sh
Last active January 26, 2026 05:13
List all starred repositories of a GitHub user.
#!/bin/bash
USER=${1:-sebble}
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-)
PAGES=$((658/100+1))
echo You have $STARS starred repositories.
echo
@wojteklu
wojteklu / clean_code.md
Last active March 11, 2026 12:56
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules