Skip to content

Instantly share code, notes, and snippets.

@RoryDungan
RoryDungan / split.hs
Created Aug 8, 2018
Split the given string up based on a max length, breaking at spaces
View split.hs
splitBy :: (a -> Bool) -> [a] -> [[a]]
splitBy p = map reverse . reverse . splitByInner [[]] p
splitByInner :: [[a]] -> (a -> Bool) -> [a] -> [[a]]
splitByInner acc _ [] = acc
splitByInner (current:rest) predicate (x:xs) =
if predicate x then
splitByInner ([]:current:rest) predicate xs
else
splitByInner ((x:current):rest) predicate xs
View User Settings.json
{
"workbench.activityBar.visible": true,
"editor.wordWrap": "off",
"editor.minimap.enabled": true,
"editor.minimap.renderCharacters": false,
//**/
"editor.fontFamily": "Fira Code",
"editor.fontSize": 14.5,
"editor.letterSpacing": -0.7,
"workbench.colorTheme": "One Dark Pro",
View .gitconfig
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.required=true
filter.lfs.process=git-lfs filter-process
user.name=Rory Dungan
user.email=rorydungan@gmail.com
diff.tool=vimdiff
difftool.winmerge.cmd=WinMergeU -e `cygpath -w $LOCAL` `cygpath -w $REMOTE`
merge.tool=vimdiff3
merge.prompt=false
@RoryDungan
RoryDungan / BuildUtility.cs
Created Sep 23, 2019
Unity Android build keystore tool
View BuildUtility.cs
using System.IO;
using UnityEditor;
using UnityEngine;
namespace Assets.Editor
{
/// <summary>
/// Utiltiy for making Android builds that automatically sets up the
/// keystore.
/// </summary>
View Internal-DeferredShading.shader
Shader "Custom/Internal-DeferredShading" {
Properties {
_LightTexture0 ("", any) = "" {}
_LightTextureB0 ("", 2D) = "" {}
_ShadowMapTexture ("", any) = "" {}
_SrcBlend ("", Float) = 1
_DstBlend ("", Float) = 1
}
SubShader {