aarondandy / wharrgarbl Goto Github PK
View Code? Open in Web Editor NEWVarious wrappers, extensions, implicit casts and other terrible things to make scriptcs a bit easier.
License: MIT License
Various wrappers, extensions, implicit casts and other terrible things to make scriptcs a bit easier.
License: MIT License
.ToDirectoryInfo
bool create
EnumerateFiles
there could be EnumerateFileNames
.Delete
that does not throw would be goodfolders.ForEach(d => d.Delete(wait: false)); folders.WaitAll(d => !d.Exists);
or something equally horrible could be handy. folders.DeleteAll(recursive: true)
could be better thoughFile.Copy(a,b)
it could be a.CopyTo(b)
Some kind of static method wrapper to allow use of var with a lambda (maybe some other trick?)
var doIt = _f(int a,string b => "meh");
and I think I have seen this before somewhere...
.Concat(x)
vs .Concat(new[]{x})
MakeList(stuff)
vs new List<T>(stuff ?? Enumerable.Empty<T>())
foreach(var thing in stuff) doIt(thing);
vs stuff.ForEach(thing => doIt(thing));
or even stuff.ForEach(doIt);
new[] { "unit", "component" }.ConcatIf(string.IsNullOrWhiteSpace(ci), "accept").Concat("pack")
ConcatIf
could have a Func version as wellstring.IsNullOrWhiteSpace(ci) ? new[] { "unit", "component", "pack" } : new[] { "unit", "component", "accept", "pack" }
can be less redundantCreate a shorter version of (T)Enum.Parse(typeof(T), text, true)
also a nullable variant.
Some anonymous/dynamic type helpers could be handy
String.Join(",",stuff)
or stuff.Join(",")
With new versions of scriptcs and roslyn the static using syntax has changed. All types with "functions" must have their usings changed.
var artifactDir = buildDir.Parent.SubDir("artifacts");
SubDir
and File
methods should take multiple parameters: folder1.File("folder2","fileName.ext")
bool create
fileInfos.Select(f => f.FullName)
could be filePaths.Cast<string>()
EnumerateFiles
there could be EnumerateFileNames
.Delete
that does not throw would be goodfolders.ForEach(d => d.Delete(wait: false)); folders.WaitAll(d => !d.Exists);
or something equally horrible could be handy. folders.DeleteAll(recursive: true)
could be better thoughFile.Copy(a,b)
it could be a.CopyTo(b)
.ToDirectoryPath
Glob searches for paths using multiple **
and *
and other things like ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.