Skip to content

Instantly share code, notes, and snippets.

View mactkg's full-sized avatar
🍼
I'm feeding milk...

mactkg mactkg

🍼
I'm feeding milk...
View GitHub Profile
@yuya-takeyama
yuya-takeyama / handleError.ts
Last active December 24, 2022 09:41
Handle Response Error of JSON API in TypeScript (using async/await)
import fetch, { Response } from 'node-fetch';
interface ResponseWithParsedJson extends Response {
parsedJson?: any;
}
const toResponseWithParsedJson = (
res: Response,
json: any,
): ResponseWithParsedJson => {
import Foundation
extension String {
func regexEscaped() -> String {
var str: String = self
"\\*+.?{}()[]-|$".forEach{
let s = String($0)
str = str.replacingOccurrences(of: s, with: "\\"+s)
}
return str
@voluntas
voluntas / react.rst
Last active May 25, 2022 11:57
React コトハジメ

React コトハジメ

日時:2017-01-02
作:@voluntas
バージョン:2.1.0
URL:https://voluntas.githu.io/

突っ込みは Twitter @voluntas まで。

#include <array>
#include "ratio.h"
template <
class A_, class B_, class C_,
class D_, class E_, class F_,
class G_, class H_, class I_
>
struct RatioMatrix {
@Akira-Hayasaka
Akira-Hayasaka / winInst.txt
Last active September 16, 2021 07:33
windows インスタレーション用設定
- windowsはオフラインアカウントでセットアップ
- ネットワークにつなぐ
- 識別されてないネットワーク問題
http://www.projectgroup.info/tips/Windows/comm_0064.html
- windowsのライセンス認証
- windowsをアップデートする
@asufana
asufana / Java8 Stream, Optional, Either and Try.md
Last active November 24, 2021 05:54
Java8 Streamから学ぶOptionalモナドとEitherモナド。

Java8 Stream, Optional, Either and Try.

Java8 Stream の使い方を覚えたら、Optional や Either もすぐ使えるようになるよ!編

Stream

リスト要素の有無を意識せずに処理することができる

@motoishmz
motoishmz / osxSetup.command
Last active February 3, 2023 07:47 — forked from rettuce/osxSetup.command
osx setup command. use com.apple.dock.plist
#!/bin/sh
### Desktop & Screen Saver
# Desktopを黒に
echo "Change Desctop Pictures"
osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/Library/Desktop Pictures/Solid Colors/Black.png"'
# ScreenSaver Kill
echo "Disable screensaver"
@asus4
asus4 / ofxMackerel.cpp
Last active November 16, 2015 06:31
ofxMackerel
//
// ofxMackerel.cpp
//
// Copyright 2015 asus4
//
//
#include <Poco/Net/HTTPClientSession.h>
#include <Poco/Net/HTTPSClientSession.h>
#include <Poco/Net/HTTPRequest.h>
@voluntas
voluntas / shiguredo_product_ strategy.rst
Last active April 16, 2024 13:24
時雨堂を支える製品戦略