Skip to content

Instantly share code, notes, and snippets.

View ZiadJ's full-sized avatar

Ziad Jeeroburkhan ZiadJ

View GitHub Profile
@ArztSamuel
ArztSamuel / ParkingCarAgent.cs
Last active May 19, 2022 08:43
Most important parts of the Agent code used for the project of https://youtu.be/VMp6pq6_QjI
public class ParkingCarAgent : Agent
{
[SerializeField]
private Transform TargetParkingSpot;
[SerializeField]
// = Reward every 'interval' units getting closer
private float DistanceRewardInterval = 3f;
// Thresholds defining when the task is complete
@bradtraversy
bradtraversy / docker_wordpress.md
Last active May 16, 2024 11:18
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@shaggun
shaggun / BendMesh.shader
Last active October 24, 2023 03:33
Bending a mesh with a shader in Unity
Shader "BendMesh"
{
Properties
{
_Texture("Texture", 2D) = "white" {}
_Color("Color", Color) = (0,0,0,0)
_Amplitude("Amplitude", Float) = 0
_Frequency("Frequency", Float) = 0
_OffsetSin("OffsetSin", Float) = 0
/***********************************************
* Copyright ? Far-Flung Creations Ltd.
* Author: Marius George
* Date: 25 October 2017
* Email: marius@farflunggames.com
* DISCLAIMER: THE SOURCE CODE IN THIS FILE IS PROVIDED ?AS IS? AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL FAR-FLUNG CREATIONS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) SUSTAINED BY YOU OR A THIRD
@MattRix
MattRix / ReadOnlyAttribute.cs
Last active September 23, 2023 16:34
Read Only Attribute for Unity (just mark stuff as [ReadOnly] the same way you would use [HideInInspector])
using UnityEngine;
using System;
using System.Reflection;
using System.Text.RegularExpressions;
[AttributeUsage (AttributeTargets.Field,Inherited = true)]
public class ReadOnlyAttribute : PropertyAttribute {}
#if UNITY_EDITOR
[UnityEditor.CustomPropertyDrawer (typeof(ReadOnlyAttribute))]
@miguel-perez
miguel-perez / readyExec.js
Last active January 29, 2023 18:04
How to add the ability to re-run $(document).ready() functions
/**
* Replace jQuery's $.fn.ready() function with a mod exec
*
* Sites that make heavy use of the $(document).ready function
* are generally incompatable with asynchrounous content. The
* the $.fn.ready function only runs once. This script replaces
* the ready function with a module execution controller that
* let's us register functions and execute all of the functions
* as we need them. This is useful after HTML gets injected on the
* page and we want to rebind functionally to the new content.
@nmsdvid
nmsdvid / new_gist_file.js
Created February 4, 2014 16:32
Simple JavaScript Debounce Function
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
clearTimeout(timeout);
@keiranlovett
keiranlovett / unity: wind
Last active November 1, 2018 21:09
Custom Wind Script = random rotation around world.space
using UnityEngine;
using System.Collections;
public class windController : MonoBehaviour {
//TODO
//1) Inwards / Outwards Direction
float t;
int direction = 1; //Direction of rotation the wind object makes
@johan
johan / README.md
Last active November 6, 2021 14:09 — forked from NV/Readme.md
JS debug breakpoint / log snippets

stopBefore.js

2min screencast

These tools inject a breakpoint, console.log or console.count in any function you want to spy on via stopBefore('Element.prototype.removeChild') or ditto stopAfter, logBefore / logAfter / logAround / logCount.

Works in Chrome DevTools and Safari Inspector; Firefox dev tools reportedly less so.

@richardkundl
richardkundl / GenericEvaulatingOrderBy.cs
Last active December 15, 2015 11:29
Extending linq order by method.
namespace Common.Extension
{
using System.Linq;
using System.Linq.Expressions;
public static class GenericEvaulatingOrderBy
{
private static IOrderedQueryable<T> OrderingHelper<T>(IQueryable<T> source, string propertyName, bool descending, bool anotherLevel)
{
var param = Expression.Parameter(typeof(T), "p");