This file contains hidden or 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
| using System; | |
| namespace MyAnimeListSharp.Auth | |
| { | |
| public class CredentialContext : ICredentialContext | |
| { | |
| public string UserName { get; set; } = | |
| Environment.GetEnvironmentVariable("Project_MyAnimeList.UserName", EnvironmentVariableTarget.User); | |
| public string Password { get; set; } = |
This file contains hidden or 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 from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import './index.css'; | |
| import FontAwesome from 'react-fontawesome'; | |
| import moment from 'moment'; | |
| function Emails({ emails }) { | |
| const emailDOM = emails.map(email => { | |
| return ( | |
| <div> |
This file contains hidden or 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
| app.get('/visitorMap/:user', (req, res) => { | |
| let user = req.params.user || "dance2die"; | |
| l("user:", user); | |
| getRepos(user) | |
| .then(response => { | |
| let repos = response.data; | |
| let visitorPromises = repos.map(repo => { | |
| l("repo", repo); | |
| return getVisitorDetail(user, repo.name) |
This file contains hidden or 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
| getAuth = () => { | |
| const password = process.env.GITHUB_DEVELOPER_KEY; | |
| return { | |
| username: "dance2die", | |
| password: password | |
| }; | |
| } |
This file contains hidden or 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
| C:\Users\dance2die>set GITHUB_DEVELOPER_KEY=abc | |
| C:\Users\dance2die>echo %GITHUB_DEVELOPER_KEY% | |
| abc |
This file contains hidden or 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
| c:\> heroku config:set GITHUB_DEVELOPER_KEY=abc | |
| Adding config vars and restarting myapp... done, v12 | |
| GITHUB_USERNAME: abc | |
| c:\> heroku config | |
| GITHUB_DEVELOPER_KEY: abc |
This file contains hidden or 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
| private void Insert(TrieNode current, string word) | |
| { | |
| foreach (char c in word) | |
| { | |
| current.Children.TryGetValue(c, out TrieNode node); | |
| if (node == null) | |
| { | |
| node = new TrieNode(); | |
| current.Children.Add(c, node); | |
| } |
This file contains hidden or 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 Data.Map | |
| data Trie a = Trie { value :: Maybe a, | |
| children :: Map Char (Trie a) } |
This file contains hidden or 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 TrieNode | |
| { | |
| public bool IsCompleteWord { get; set; } = false; | |
| public Dictionary<char, TrieNode> Children => new Dictionary<char, TrieNode>(); | |
| } |
This file contains hidden or 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 TrieBuilder | |
| { | |
| public TrieNode BuildTrie(IEnumerable<string> words) | |
| { | |
| TrieNode root = new TrieNode(); | |
| foreach (var word in words) | |
| { | |
| Insert(root, word); | |
| } | |