Skip to content

Instantly share code, notes, and snippets.

View rdeeb's full-sized avatar

Ramy Deeb rdeeb

View GitHub Profile
@rdeeb
rdeeb / BoundryFinder.cs
Created March 17, 2016 03:54
Get the viewport size of an orthographic camera in unity
public class BoundryFinder : MonoBehaviour
{
public float xMin, xMax, zMin, zMax;
void Start()
{
GameObject sceneCamObj = GameObject.Find( "Main Camera" );
Camera mainCam = sceneCamObj.GetComponent<Camera> ();
Transform camPos = mainCam.transform;
@rdeeb
rdeeb / get_associated_terms.php
Last active May 6, 2018 17:34
This piece of code gets the categories used by a list of posts in Wordpress, this also can be filtered to only show categories that are children of an specific category
<?php
/**
* This function will return a list of categories used by a group of posts ids
*
* @param string $taxonomy The name of the taxonomy to search for
* @param array $objects_id The list of posts IDs to check against
* @param integer $child_of A parent category to limit the search on
*
* @return array A list of terms