Skip to content

Instantly share code, notes, and snippets.

View musicm122's full-sized avatar
🏠
Working from home

Terrance Smith musicm122

🏠
Working from home
View GitHub Profile
@musicm122
musicm122 / getFileExt
Last active August 29, 2015 14:22
Clojure getFileExt
(defn getFileExt
[& *args*] (apply getFileExt *args* )
[arg] (str (subs arg (.lastIndexOf arg "." )))
;;This works
;;(getFileExt "hello.txt")
;;this gives me invalid number of args
;;(getFileExt ["hello.txt" "test.end"])
#if UNITY_EDITOR
using System;
using System.IO;
using System.Linq;
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.Collections.Generic;
using Extensions;
public static string CreateCode(Condition node)
{
StringBuilder sb = new StringBuilder();
sb.Append("if(");
while (node!=null)
{
if(node.HasNot)
{
sb.Append("!");
}
public class Condition
{
public int Order {get;set;}
public string expression {get;set;}
public LogicalOperator LogicalOperator {get;set;}
public bool HasNot{get;set;}
public Condition Right {get;set;}
}
public static Condition MoveRight(this Condition node)
{
return node.Right;
}
@musicm122
musicm122 / node5.cs
Created July 27, 2014 23:49
Node5_recursive
public static void RecurseSet(this Node node, List<string> vals)
{
Node tNode;
for(var i=0;i&lt;vals.Count();i++)
{
tNode = new Node();
tNode.Value = vals[i];
node.Right = tNode;
vals.Remove(vals[i]);
RecurseSet(tNode,vals);
public static string GetValues(Node node)
{
StringBuilder sb = new StringBuilder();
while (node.Value!=null)
{
sb.Append(node.Value);
node = node.Right;
}
return sb.ToString();
}
public static Node GetRightMostNode(Node node)
{
while(node.Value!=null)
{
node = node.MoveRight();
}
return node;
}
public static Node MoveRight(this Node node)
{
return node.Right;
}
@musicm122
musicm122 / node.cs
Last active August 29, 2015 14:04
Node in C#
public class Node
{
public string Value{get;set;}
public Node Right {get;set;}
}