Skip to content

Instantly share code, notes, and snippets.

View bendangelo's full-sized avatar

Ben D'Angelo bendangelo

View GitHub Profile
@bendangelo
bendangelo / telegram_notifier.rb
Created January 3, 2024 17:53
Telegram notifier for exception notifier gem
# inside initializers/exception_notifier.rb
# Webhook notifier sends notifications over HTTP protocol. Requires 'httparty' gem.
# config.add_notifier :telegram, {
# api_key: Rails.application.credentials.telegram_api,
# chat_id: Rails.application.credentials.telegram_chat,
# backtrace_length: 10,
# body: {
# disable_notification: true,
# parse_mode: "HTML"
# }
@bendangelo
bendangelo / chromable.rb
Created December 11, 2023 01:08
Add Chromadb methods to your Rails Models. This is a model concern.
# Add to model:
# include Chromable
# chroma do
# hnsw_space :cosine
# embedding :name
# document :label
# metadata :name
# end
# Usage:
@bendangelo
bendangelo / StatList.cs
Created March 6, 2022 22:04
Set any number of custom values to items, abilities etc for an RPG.
// (c) 2022 Ben D'Angelo. www.throwtheproject.com
// This code is licensed under MIT license (see LICENSE.txt for details)
using System.Collections;
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Assertions;
public class StatList {
@bendangelo
bendangelo / TileNode.cs
Created March 6, 2022 17:08
A tile searching algorithm for tactical-rpgs like games or any tile-based game. Unity C#
// (c) 2022 Ben D'Angelo. www.throwtheproject.com
// This code is licensed under MIT license (see LICENSE.txt for details)
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Assertions;
using System;
public class TileNode {
public Vector2 pos;
@bendangelo
bendangelo / Node.cs
Created March 5, 2022 21:12
PathFind & PathFindProps classes for finding paths in tile-based games
// (c) 2022 Ben D'Angelo. www.throwtheproject.com
// This code is licensed under MIT license (see LICENSE.txt for details)
using UnityEngine;
using System.Collections;
using System;
public class Node : IComparable<Node> {
public Vector2 pos;
public Node parent;
@bendangelo
bendangelo / haxe-openfl.sh
Created June 6, 2021 17:30 — forked from moret/haxe-openfl.sh
Install Haxe using Brew and set the haxelib path
# Install Haxe using Brew and set the haxelib path
brew install haxe
haxelib setup /usr/local/Cellar/haxe/lib
# Install lime
haxelib install lime
# Install lime tools
haxelib install format
haxelib install svg
@bendangelo
bendangelo / README.md
Created January 8, 2021 11:19 — forked from mandarinx/README.md
Sprite outlines shader
@bendangelo
bendangelo / UnityBuildAll.sh
Created November 29, 2017 16:05
OSX script to build unity games.
HELP="
#################################################
# #
# UnityBuildAll #
# #
#################################################
# A simple script by SnowHydra #
# #
# Automated building of your Unity app #
# To Windows, Mac, Linux. #
@bendangelo
bendangelo / AutoSubstitiute.cs
Last active May 8, 2017 18:06
Auto substitute helper method for Zenject.
using UnityEngine;
using System.Collections;
using Zenject;
using NSubstitute;
/*
Usage:
Container.Bind<IPath>().FromSub<IPath>();
Container.Bind<IPath>().FromSub();
*/
@bendangelo
bendangelo / StatRange.cs
Created September 8, 2016 03:59
Unity3D class used for health bars and anything else that has a min / max.
using UnityEngine;
using System.Collections;
public class StatRange {
public int min { get; set; }
public int max { get; set; }
public int value { get; set; }
public StatRange(int min = 0, int max = 0) {