Skip to content

Instantly share code, notes, and snippets.

View harapeko's full-sized avatar
🍊
毎日が大晦日

harapeko harapeko

🍊
毎日が大晦日
View GitHub Profile
const copyObj = (originObj) => {
const originPrototype = Object.getPrototypeOf(originObj);
let newObj = Object.create(originPrototype);
const originObjOwnProperties = Object.getOwnPropertyNames(originObj);
originObjOwnProperties.forEach((property) => {
const prototypeDesc = Object.getOwnPropertyDescriptor(originObj, property);
Object.defineProperty(newObj, property, prototypeDesc);
});
@mpppk
mpppk / clean_architecture.md
Last active July 2, 2024 01:58
クリーンアーキテクチャ完全に理解した

2020/5/31追記: 自分用のメモに書いていたつもりだったのですが、たくさんのスターを頂けてとても嬉しいです。
と同時に、書きかけで中途半端な状態のドキュメントをご覧いただくことになっており、大変心苦しく思っています。

このドキュメントを完成させるために、今後以下のような更新を予定しています。

  • TODO部分を埋める
  • 書籍を基にした理論・原則パートと、実装例パートを分割
    • 現在は4層のレイヤそれぞれごとに原則の確認→実装時の課題リスト→実装例という構成ですが、同じリポジトリへの言及箇所がバラバラになってしまう問題がありました。更新後は、実装時の課題リストを全て洗い出した後にまとめて実装を確認する構成とする予定です。

2021/1/22追記:

@kazuho
kazuho / git-blame-pr.pl
Last active June 28, 2022 07:15
git-blame by PR #
#! /usr/bin/perl
#
# Written in 2017 by Kazuho Oku
#
# To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
#
use strict;
use warnings;
@james2doyle
james2doyle / git.fish
Last active May 1, 2023 21:10
Git abbreviations for Fish shell
# tj git aliases
abbr -a gd "git diff -M"
abbr -a ga "git add"
abbr -a gaa "git add --all ."
abbr -a gbd "git branch -D"
abbr -a gs "git status"
abbr -a gca "git commit -a -m"
abbr -a gm "git merge --no-ff"
abbr -a gpt "git push --tags"
abbr -a gp "git push"
@Nyoho
Nyoho / makedocset.py
Last active May 7, 2021 01:04 — forked from hetima/makedocset.py
Python 3.6.1 日本語ドキュメントを Dash.app に追加する
#!/usr/bin/env python3
import urllib.request
import urllib.parse
from bs4 import BeautifulSoup
import os
import copy
from shlex import quote
# 生成される docset の名前。カレントディレクトリに作られる
@manabuyasuda
manabuyasuda / From-engineers-to-designers.md
Last active September 12, 2022 06:33
エンジニアからデザイナーに向けて、デザインカンプを作るときにしておいて欲しいこと。

エンジニアからデザイナーに向けて、デザインカンプを作るときにしておいて欲しいこと。

デザインカンプをコーディングするときに困りがちなことや、こうしてもらえると助かることなどをまとめています。デザイナーが他のデザイナーのデザインカンプを引き継ぐこともあるので、誰にとっても使いやすいデザインカンプを作ることは大切なことだと思います。

このドキュメントは指示ではなく、エンジニア目線の提案です。必ずしも正しいとは考えていませんし、このドキュメントをもとに意見を出し合えたらと思っています。

基本的にデザインカンプに残して欲しいとしていますが、共有されているのであればデザインカンプ以外でも構いません。デザイナーの頭の中にだけある状態はさけたいと考えているので、ストックしておく場所としてデザインカンプを選んでいます。

ツーツはPhotoshopを想定しています。これは単純にPhotoshopで作られることが多いからです。違うツールを使っている場合は、読み替えるか、読み飛ばしてください。

全体編

@padde
padde / c9-elixir.sh
Last active June 1, 2023 02:09
Install Script for Erlang/Elixir/Phoenix on Cloud9
#!/usr/bin/env bash
############### USAGE ###############
#
# 1. Create a new workspace on Cloud9 using the "Blank" template
#
# 2. Run this command in the console:
# bash <(curl -fsSL https://gist.githubusercontent.com/padde/3c6301f15cbd5025e131740dae33aa95/raw/c9-elixir.sh)
#
# 3. There is no step 3!
@yociya
yociya / amazon-history.js
Last active June 24, 2023 23:33
Amazonの注文履歴を年毎に集計して出力します 利用額 / 注文件数 / 最高額(1注文での) 使い方はコメントを参照
var historyUrl = 'https://www.amazon.co.jp/gp/css/order-history?orderFilter=year-$year$&startIndex=$index$';
function beforeSendHook(xhr){
xhr.setRequestHeader('X-Requested-With'
, {
toString: function(){
return '';
}
}
);
#!/bin/bash
BRANCH=$(git rev-parse --abbrev-ref HEAD)
REMOTE=$(git config --get branch.${BRANCH}.remote)
if [ -z ${REMOTE} ]; then
echo "no remote"
exit -1
fi
git fetch
if [ $? != 0 ]; then