Skip to content

Instantly share code, notes, and snippets.

View ygkn's full-sized avatar
A believing heart is your magic.

YAGITA Yugo ygkn

A believing heart is your magic.
View GitHub Profile
@DQNEO
DQNEO / isbn13to10.js
Last active November 6, 2020 23:22
JavaScriptでISBN13をISBN10に変換する関数。
/**
* ISBN13をISBN10に変換する関数。
*
* Usage
* console.log(isbn13to10("9784063842760"));
* > "4063842762"
*
* # 変換ロジックの解説(例:"9784063842760")
* 1. ISBN13の先頭3文字と末尾1文字を捨てる => "4063842760"
* 2. 4*10 + 0*9 + 6*8 + 3*7 + 8*6 + 4*5 + 2*4 +7*3 + 6*2 = 218
@vain0x
vain0x / dict_math_signs.txt
Last active July 7, 2024 01:01
数学記号辞書
|| ∨ 記号 (代替表記)
&& ∧ 記号 (代替表記)
! ¬ 記号 (代替表記)
|ー ├ 記号 (略記)
|= ⊨ 記号 (略記)
<: ⊂ 記号 (一般的でない代替表記)
<:= ⊆ 記号 (一般的でない代替表記)
:> ⊃ 記号 (一般的でない代替表記)
:>= ⊇ 記号 (一般的でない代替表記)
:: ∈ 記号 (一般的でない代替表記)
@kentcdodds
kentcdodds / package-exact.js
Last active June 15, 2024 12:09
make your package.json dependencies be the exact version that's in your node_modules currently
/* jshint node:true */
/* eslint-env node */
/*
* This will look at the current version of all of your dependencies and update your package.json
* with the specific version that you currently have in node_modules. This will save you from the
* sadness that is: DEPENDENCY MANAGEMENT
*
* Place this file in a folder that's a a sibling to your package.json and node_modules
* Then simply run: node scripts/package-strict
(1..1000000).reduce { |a, e| a = "#{a * e}".sub(/\d*?(\d{0,9})0*$/, '\1').to_i }
@0x263b
0x263b / colors.md
Last active July 13, 2024 19:15
Random color from string in javascript

Random color from string in javascript

Consider a list of strings you need to permanently assign a random color.

First you should turn the string into a hash.

var string = "string"
var hash = 0
@ysakasin
ysakasin / code.py
Last active February 11, 2017 08:47
某アニメで主人公が作成していたコード
def __delitem__(self, key):
self.db.delete(self.table, where="session_id=$key", vars= # 見切れている
def cleanup(self, timeout):
timeout = datetime.# 入力中により以後不明
@mizchi
mizchi / predict-frontend.md
Last active May 12, 2023 03:43
React のユーザーから見た今後のフロントエンドの予想

この記事は議論のたたき台で、ポジショントークや、偏見にまみれています。

今のフロントエンドの分類

  • 古典的なサーバーサイド WAF への +α の味付け
  • 大規模なクライアントアプリケーション管理のための SPA
  • SEO / SSR を考慮した Node ヘヴィーな環境

他、提唱されてるパターン

@yidas
yidas / js-nl2br-br2nl.md
Last active July 23, 2024 04:23
JavaScript nl2br & br2nl functions

JavaScript nl2br & br2nl functions

The exchange of new line & br HTML tag could refer to PHP - nl2br() function, which uses to inserts HTML line breaks before all newlines in a string.

These JavaScript functions consider whether to use insert or replace to handle the swap.

nl2br

@mizucoffee
mizucoffee / main.rb
Last active December 4, 2019 03:26
Rubyの挙動メモ
list = [0, 'a', false]
p list[0] # 括弧で取得
# ==========================
# シンボルリテラルだとシンボルリテラルで、アロー表記だとstringで取得できる
hash = {
a: 'data-a',

#NoSQLデータモデリング技法

原文:NoSQL Data Modeling Techniques « Highly Scalable Blog

I translated this article for study. contact matope[dot]ono[gmail] if any problem.

NoSQLデータベースはスケーラビリティ、パフォーマンス、一貫性といった様々な非機能要件から比較される。NoSQLのこの側面は実践と理論の両面からよく研究されている。ある種の非機能特性はNoSQLを利用する主な動機であり、NoSQLシステムによく適用されるCAP定理がそうであるように分散システムの基本的原則だからだ。一方で、NoSQLデータモデリングはあまり研究されておらず、リレーショナルデータベースに見られるようなシステマティックな理論に欠けている。本稿で、私はデータモデリングの視点からのNoSQLシステムファミリーの短い比較といくつかの共通するモデリングテクニックの要約を解説したい。

本稿をレビューして文法を清書してくれたDaniel Kirkdorfferに感謝したいと思う