Skip to content

Instantly share code, notes, and snippets.

View idhowardgj94's full-sized avatar
🎯
Focusing

HowardChang idhowardgj94

🎯
Focusing
View GitHub Profile
@idhowardgj94
idhowardgj94 / vim_cheatsheet.md
Created November 20, 2020 01:51 — forked from awidegreen/vim_cheatsheet.md
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
runningSum :: [ Int ] -> Maybe [ Int ]
runningSum x = Just (sum' x a)
    where a = 0; sum' [] a =  []
          sum' (x:xs) a = (a+x) : sum' xs (a+x)

main = do
    putStrLn "1480. Running Sum of 1d Array"
    putStrLn "https://leetcode.com/problems/running-sum-of-1d-array/"
@idhowardgj94
idhowardgj94 / reply.md
Last active June 17, 2020 02:52
reply
function 有分 declare 跟 invoke 對吧
type 也有
對 term level 來講 type 不管是 declare 還是 invoke ,都是宣告

我大概理解這個問題了。我會有這樣錯誤的觀念,是我之前在寫 ts 版本的 redux saga的時候,遇到這個問題。

redux-saga/redux-saga#1883

當時我的解決方式,是將 takeLatest 加上 any, error訊息就消失了。

// Import stylesheets
import './style.css';
// Write TypeScript code!
const appDiv: HTMLElement = document.getElementById('app');
appDiv.innerHTML = `<h1>TypeScript Starter</h1>`;
// const id = x => x
// const a = 1
// create a Box which turns this

https://codesandbox.io/s/hardcore-swanson-jhqq9?fbclid=IwAR0fKuw8Sv_uqpUq_VJ9Bb_HE6zZ_2qxEuY8uBZiq59fUe1wwZ_7F2RO9EQ&file=/src/monad/Box.ts

針對提到的第一點,我想要針對我的觀念做一點釐清跟討論。

我今天認真的看了一下 讀書會 第二場,跟一些 Learn You a Haskell for Great Good 的內容。

我發現 haskell 裡的所有的 function 都只接受一個 param,並回傳一個function 接受下一個 param。

其實在 oo 中,可以 combine 起來,變成一個 function,接受兩個 parameter。

@idhowardgj94
idhowardgj94 / gatsby_config.js
Last active July 20, 2021 03:05
gastsby note
module.exports = {
siteMetadata: {
title: `Blog`,
description: `serve my blog post`,
author: `@Howard`,
},
plugins: [
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
@idhowardgj94
idhowardgj94 / oauth_example.md
Last active May 5, 2020 12:11
oauth example in php
<?php

namespace App\Services;

use GuzzleHttp\Psr7;
use GuzzleHttp\Psr7\Uri;

abstract class OauthRequestBase
{
@idhowardgj94
idhowardgj94 / sample.md
Created February 23, 2020 13:16
angular http test
// Http testing module and mocking controller
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';

// Other imports
import { TestBed } from '@angular/core/testing';
import { HttpClient, HttpErrorResponse } from '@angular/common/http';

import { HttpHeaders } from '@angular/common/http';
@idhowardgj94
idhowardgj94 / test.md
Last active February 14, 2020 02:02
javascript
const a = Object.create({
 localVar: 1
 count: () => {
  this.localVar = this.localVar + 1
  console.log("localVar now is " + this.localVar)
 }
})

// 以上等價於
@idhowardgj94
idhowardgj94 / a.markdown
Last active January 6, 2020 05:22
debian 10 apache reverse proxy

打開proxy相關的模組。

    sudo a2enmod proxy
    sudo a2enmod proxy_http
    sudo a2enmod proxy_balancer
    sudo a2enmod lbmethod_byrequests

在你的網站設定檔中(如果你使用apache2,通常在/etc/apache2/sites-available底下),加上以下設定: