Skip to content

Instantly share code, notes, and snippets.

View adrianoc's full-sized avatar

Adriano Carlos Verona adrianoc

View GitHub Profile
# finding all file extensions in a subfolder excluding some specific ones.
find folder -type f ! \( -iname *.excluded \) | sed 's|.*\.||' | sort -u
public class Bar
{
// int field = 1; // Looks to be working
public long Foo()
{
double d = 1.0f;
//int i = 10; // Looks to be working
return 1;
}
//
using System;
class Test
{
static string M(int i) { return i.ToString(); }
void Foo()
{
Func<int, string> conv = M;
// https://github.com/adrianoc/cecilifier/issues/59
using System;
class Test
{
static string M(int i) { return i.ToString(); }
public void Foo()
{
Func<int, string> conv;
@adrianoc
adrianoc / DelegateExample.cs
Created November 27, 2020 15:47
Used i Stackoverflow answer
using System;
class Test
{
static string M(int i) { return i.ToString(); }
Func<int, string> conv = M;
}
class Foo
{
System.Collections.Generic.IList<System.Text.RegularExpressions.Regex> list;
}
@adrianoc
adrianoc / LinuxUsage.md
Last active May 1, 2023 11:49
useful Linux usage info

Linux notes

enable debug native code

sudo sysctl kernel.yama.ptrace_scope=0

add ssh keys to access git repos

$ eval "$(ssh-agent -s)" $ ssh-add path-to-private key

using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Mono.Cecil;
using Mono.Cecil.Cil;
namespace gen
{
class Program
@adrianoc
adrianoc / RemoveNonScriptAssets.sh
Last active June 2, 2023 18:25
Remove any non script related asset from current (and child) directory
#!/bin/bash
IFS=' ' read -ra FILEEXTS <<< "*.tga *.psd *.wav *.exr *.ttf *.jpg *.png *.fbx *.mp3 *.mp4 *.shader *.shadergraph *.mat *.playable *.controller *.prefab *.unity *.cubemap *.anim *.asset *.hdr *.dds *.max *.mesh *.vfx *.brush *.inputactions *.mixer *.overrideController *.shadersubgraph *.shadervariants *.swatch *.terrainlayer *.tpsheet *.txt *.blend *.bmp *.tif *.blend1"
for FILE_EXT in "${FILEEXTS[@]}"; do
echo $FILE_EXT
find . -iname "$FILE_EXT" -exec rm -rf {} \;
find . -iname "$FILE_EXT.meta" -exec rm -rf {} \;
done