$/
artifacts/
build/
docs/
lib/
packages/
samples/
src/
tests/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class Job : IDisposable | |
{ | |
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)] | |
static extern IntPtr CreateJobObject(IntPtr a, string lpName); | |
[DllImport("kernel32.dll")] | |
static extern bool SetInformationJobObject(IntPtr hJob, JobObjectInfoType infoType, IntPtr lpJobObjectInfo, UInt32 cbJobObjectInfoLength); | |
[DllImport("kernel32.dll", SetLastError = true)] | |
static extern bool AssignProcessToJobObject(IntPtr job, IntPtr process); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Enums | |
{ | |
public static IList<dynamic> ListFrom<T>() | |
{ | |
var list = new List<dynamic>(); | |
var enumType = typeof(T); | |
foreach (var o in Enum.GetValues(enumType)) | |
{ | |
list.Add(new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "System.DirectoryServices" | |
using System.DirectoryServices; | |
using System.IO; | |
var fullNames = new List<string>(); | |
foreach (var credential in File.ReadAllLines("credentials.txt")) | |
{ | |
if (credential.IndexOf('\\') > 0) |
I've had lots of discussions with people over the past few days around how open source projects in the .NET space have poor documentation (if it exists). So how do we fix this?
At a high-level, I've got these goals in mind:
- make it easy
- make it cool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Struct Store | |
// | |
// Version 1: We may have written... | |
DocumentDatabase db = new DocumentDatabase(); | |
User user = new User(); | |
user.Id = 123; | |
user.FirstName = ....; | |
user.LastName = ....; | |
user.Bio = ....; |
To toast:
- Make sure you have ImageMagick installed (
brew install imagemagick
) - Change line 7 of toast.rb to the repository name you're working with
- toast!
$ bundle install
$ ./get_token [user] [pass]
$ export GHUSER=[myuser]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GenericRepository<TEntity> : IGenericRepository<TEntity> where TEntity : class, IId | |
{ | |
internal DbContext Context; | |
internal DbSet<TEntity> DbSet; | |
public ICache Cache { get; set; } | |
public GenericRepository(DbContext context) | |
{ | |
Context = context; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usage | |
_db.Query<Story, Stories_Search>() | |
.If(status.HasValue, q => q.Where(x => x.Status == status)) | |
.If(!curatorId.IsEmpty(), q => q.Where(x => x.CuratorId == curatorId)) | |
.If(publicationDate.HasValue, q => q.Where(x => x.ProposedPublicationDate == publicationDate.Value.Date)) | |
.OrderByDescending(x => x.CreatedAt) | |
.ToPagedList(page, size); | |
Assuming you have the following object:
public class Person {
public string Name { get; set; }
public string Surname { get; set; }
public int Age { get; set; }
}
and got a PATCH request as below:
NewerOlder