Skip to content

Instantly share code, notes, and snippets.

[TestFixture]
public class DarkThreadTests
{
[Test]
public void find_repeat_group()
{
var source = new[] { "A", "B", "B", "C", "X", "C", "C", "B", "B", "D", "D", "D" };
var expected = new[]
{
new[] { "B", "B" },
@hatelove
hatelove / factory_method.js
Last active October 2, 2021 15:30
factory method of class from json
class Order {
static from(json) {
return json ? Object.assign(new Order(), json) : null;
}
}
@hatelove
hatelove / babel with jest
Last active October 10, 2022 20:59
jest installation
yarn add --dev babel-jest @babel/core @babel/preset-env
@hatelove
hatelove / Update git fork with tags.sh
Created February 27, 2020 04:08 — forked from Saissaken/Update git fork with tags.sh
Update git fork with tags
# Repo: someuser/myframework
# Fork: superteam/myframework
# Track:
git clone https://github.com/superteam/myframework.git
cd myframework
git remote add upstream https://github.com/someuser/myframework.git
# Update:
git fetch upstream
@hatelove
hatelove / AfterRefactoring.cs
Created February 18, 2019 16:18
Powerful JetBrains: Visual Studio + ReSharper
using System;
namespace PowerfulJetBrains
{
public class ContactInfo
{
public ContactInfo(string email, string phone, string address)
{
Email = email;
Phone = phone;
@hatelove
hatelove / Medical.cs
Last active November 22, 2018 15:09
.net framework 2.0 version sample code
using System.Collections.Generic;
namespace UnitTestProject4
{
public class Medical
{
public Medical(int year, string content)
{
Year = year;
Content = content;
<?php
/**
* Created by PhpStorm.
* User: joeychen
* Date: 2018/10/15
* Time: 上午 11:47
*/
namespace App;
@hatelove
hatelove / actionlist.vim
Created January 21, 2018 11:47 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
<?php
/**
* Created by PhpStorm.
* User: JoeyChen
* Date: 2017/12/2
* Time: 下午 01:28
*/
namespace JoeyDojo;
@hatelove
hatelove / before.cs
Created August 27, 2017 04:46
learning from teaching, web testing with page objects in the better way
[TestMethod]
public void Test_輸入關鍵字_skilltree_進行搜尋_搜尋結果第一頁應出現skilltree官網的連結()
{
//arrange
//到google search首頁
var googleSearchPage = new GoogleSearchPage(this);
googleSearchPage.Go();
//act
//搜尋skilltree