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
static async Task Execute() { | |
var client = new GitHubClient(new ProductHeaderValue("my-cool-app")); | |
var basicAuth = new Credentials("githubusername", "githubpassword"); // NOTE: not real credentials | |
client.Credentials = basicAuth; | |
var repos = await client.Repository.GetAllForUser("githubusername"); | |
var tasks = repos.Select(repo => client.Repository.Delete("githubusername", repo.Name)); | |
Task.WaitAll(tasks.ToArray()); | |
} |
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
import React, {Component} from 'react'; | |
import {BootstrapTable, TableHeaderColumn} from 'react-bootstrap-table'; | |
import _ from 'lodash'; | |
const dataTable = _.range(1, 60).map(x => ({id: x, name: `Name ${x}`, surname: `Surname ${x}`})); | |
// Simulates the call to the server to get the data | |
const fakeDataFetcher = { | |
fetch(page, size) { | |
return new Promise((resolve, reject) => { |
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
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)] | |
public class UserConfirmedFilterAttribute : ActionFilterAttribute | |
{ | |
public override void OnActionExecuting(ActionExecutingContext filterContext) | |
{ | |
var userId = filterContext.HttpContext.User.Identity.GetUserId(); | |
var userManager = filterContext.HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>(); | |
if (!userManager.IsEmailConfirmedAsync(userId).Result) | |
{ |