- Get VS Code
- Remove using NUnit.Framework;
- Add using XUnit;
- Replace all [Test] with [Fact]
- Replace [SetUp] with a constructor
- Replace Assert.That(actualValue, Is.EqualTo(value)); with Assert.Equal(expected, actual)
- highlight Is.EqualTo(
- Delete it
- Select to the end of the line
- Ctrl + X
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
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Mvc.Testing; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.DependencyInjection.Extensions; | |
using Tweetbook.Contracts.V1; | |
using Tweetbook.Contracts.V1.Requests; | |
using Tweetbook.Contracts.V1.Responses; |
Create a script called Terminal (yes, without a extension) inside the folder ~/.local/share/nautilus/scripts with the following content:
Create File: /home/m/.local/share/nautilus/scripts/Termial
#!/bin/sh
gnome-terminal
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
#!/bin/bash | |
echo "LC_ALL=en_US.UTF-8" | sudo tee -a /etc/environment | |
echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen | |
echo "LANG=en_US.UTF-8" | sudo tee -a /etc/locale.conf | |
sudo locale-gen en_US.UTF-8 |
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
# I want to sync the local clock but don't have access to any NTP server. | |
# Websites such as https://time.is give me the correct time and I can manually adjust the local clock. | |
# But then I recall that a HTTP response often contains a date header with current time in GMT timezone. | |
# I'll use it to set the system clock with the precision of 1 or 2 seconds. | |
# in Linux | |
sudo date -us "$(curl -Is google.com | grep '^Date:' | cut -d' ' -f3-)" | |
# in Linux with fish shell |
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
#!/bin/bash | |
iatest=$(expr index "$-" i) | |
####################################################### | |
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me | |
####################################################### | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc |
We will compare ASP.NET and Node.js for backend programming.
Source codes from examples.
This document was published on 21.09.2015 for a freelance employer. Some changes since then (14.02.2016):
- Koa.js no longer uses co-routines, it has switched to Babel's
async/await
.yield
andawait
are used almost in the same way, so I see no point to rewrite the examples.
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
<?php | |
namespace App\Traits; | |
use Illuminate\Http\Request; | |
use Symfony\Component\HttpFoundation\Response as SymfonyResponse; | |
trait ApiRespond | |
{ | |
/** |
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
<?php | |
namespace App\Traits; | |
trait FullTextSearch | |
{ | |
/** | |
* Replaces spaces with full text search wildcards | |
* | |
* @param string $term |
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
<?php | |
namespace App\Traits; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Storage; | |
trait FileTrait | |
{ |