Skip to content

Instantly share code, notes, and snippets.

<?php
function reverse_array($arr){
if(count($arr) > 1){
$sub = reverse_array(array_slice($arr, 1));
$sub[] = $arr[0];
return $sub;
} else {
return $arr;
}
@celestocalculus
celestocalculus / GaussianElimination.java
Last active August 29, 2015 14:13
Matrix multiplication using Gaussian elimination.
/*
* Date created, Sunday 26th March, 2009.
* Coded by: Celestine Ezeokoye
*/
package gaussianelimination;
import java.util.Scanner;
public class GaussianElimination {
@celestocalculus
celestocalculus / StringHelper.cs
Last active November 1, 2018 04:47
.NET Core is new and is missing a couple of important extension functions. As I create them for my current code (on a "as I discover them" basis), I'll update this gist.
namespace Tiketmobile.Helpers
{
public static class StringHelper
{
public static string ToTitleCase(this TextInfo textInfo, string str)
{
var tokens = str.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < tokens.Length; i++)
{
var token = tokens[i];