Skip to content

Instantly share code, notes, and snippets.

View ronald112's full-sized avatar
🎱
struggling with code

ronald112

🎱
struggling with code
View GitHub Profile
@Adjuvant
Adjuvant / GetComponentsOnlyInChildren.cs
Created December 30, 2018 20:56
Unity component search, recursive and non-recursive
using System.Collections.Generic;
using UnityEngine;
public static class UtilityExtensions
{
/// <summary>
/// Gets the components only in immediate children of parent.
/// </summary>
/// <returns>The components only in children.</returns>
/// <param name="script">MonoBehaviour Script, e.g. "this".</param>
@svdamani
svdamani / sorts.hpp
Last active May 29, 2024 00:04
Sorting Algorithms using Iterators in C++
#include <algorithm>
template <class Iterator>
inline void BubbleSort(Iterator begin, Iterator end) {
for (Iterator i = begin; i != end; ++i)
for (Iterator j = begin; j < i; ++j)
if (*i < *j)
std::iter_swap(i, j);
}
/** Pipeline between three processes.
http://stackoverflow.com/q/20056084/
See @chill's answer: http://stackoverflow.com/a/8092270
*/
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@parse
parse / shell.c
Created May 11, 2011 07:31
Simple shell in C
/* Compile with: g++ -Wall –Werror -o shell shell.c */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>