Skip to content

Instantly share code, notes, and snippets.

View blackjackkent's full-sized avatar

Rosalind W. blackjackkent

View GitHub Profile
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
public class ComputerController : Controller {
private readonly IComputerService _computerService;
private readonly IComputerRepository _computerRepository;
public ComputerController(IComputerService computerService, IComputerRepository computerRepository)
{
_computerService = computerService;
_computerRepository = computerRepository;
}
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
public class ComputerController : Controller {
private readonly IComputerService _computerService;
private readonly IComputerRepository _computerRepository;
public ComputerController(IComputerService computerService, IComputerRepository computerRepository)
{
_computerService = computerService;
_computerRepository = computerRepository;
}
public class ComputerService : IComputerService {
public Computer UpdateComputer(Computer computer, string userId, IComputerRepository computerRepository) {
// ...
}
public void AssertComputerIsValid(Computer computer) {
var isValid = //....logic here to check computer validity...
if (!isValid) {
throw new InvalidComputerException();
}
public class InvalidComputerException : Exception
{
public InvalidComputerException() : base("The supplied computer information is invalid.")
{
}
}
public class UnauthorizedRequestException : Exception
{
public UnauthorizedRequestException() : base("The current user is not authorized to make this request.")
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
public class ComputerController : Controller {
private readonly IComputerService _computerService;
private readonly IComputerRepository _computerRepository;
public ComputerController(IComputerService computerService, IComputerRepository computerRepository)
{
_computerService = computerService;
_computerRepository = computerRepository;
}
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
public class ComputerController : Controller {
private readonly IComputerService _computerService;
private readonly IComputerRepository _computerRepository;
public ComputerController(IComputerService computerService, IComputerRepository computerRepository)
{
_computerService = computerService;
_computerRepository = computerRepository;
}
<div class="post_content_inner clearfix">
<div class="post_container">
<div class="reblog-list">
<div class="reblog-list-item original-reblog-content">
<div class="reblog-header"><a class="reblog-avatar " href="http://tmblr.co/mWvR6TrF-S3KwRZ9ySUUdEg"><img class="reblog-avatar-image-thumb" src="https://33.media.tumblr.com/avatar_ddc9e7cc8b58_64.png"></a><a class="reblog-tumblelog-name post_info_link" href="http://aaaaa42.tumblr.com/post/78389575025">aaaaa42</a></div>
<div class="reblog-content">
<p>some<i>body</i> once trolled me, successfully rickroll’d me</p>
</div>
</div>
<div class="reblog-list-item ">
@blackjackkent
blackjackkent / _proposal.md
Last active September 2, 2015 02:23
Thoughts on a potential Tumblr competitor -- Pipeline

The name is, by no means, an absolute suggestion, just a placeholder.

#Purpose

We have been discussing the possibility of booting up a site which would act as a competitor to Tumblr, offering similar functionality capturing the best of what it offers to the community, while doing away with some of its failings.

The pros of Tumblr as a community include:

  • Sharing of user-created content (including but not limited to GIFs, digital art, original and fanfictional writing, music, and short "microblog" commentary) on a chronologically oriented stream
  • Ability to conduct conversations within a piece of content, adding to it and modifying it as it is shared
  • Inclusive environment for fans of a variety of pop-culture fandoms to congregate
@blackjackkent
blackjackkent / tumblr_request.json
Created August 31, 2015 16:27
Tumblr's post object vs Xkit's when adding a tag to a content-less video post draft
{
"channel_id": "blackjackkent-xkit",
"post_id": "128035186297",
"post[date]": "Aug 31st, 2015 11:54:09am",
"post[one]": "https://www.youtube.com/watch?v=segVgjfKMuA",
"post[publish_on]": "",
"post[slug]": "",
"post[tags]": "test",
"post[two]": "",
"editor_type": "rich",
@blackjackkent
blackjackkent / tumblrrequest.json
Created August 31, 2015 16:14
The request Tumblr sends to edit the tags on a drafted post
{
"channel_id": "blackjackkent-xkit",
"post_id": 128035949517,
"post[date]": "Aug 31st, 2015 12:07:24pm",
"post[one]": "",
"post[publish_on]": "",
"post[slug]": "",
"post[tags]": "test,test2",
"post[two]": "<p>test</p>",
"editor_type": "rich",