Skip to content

Instantly share code, notes, and snippets.

@ikemo3
ikemo3 / google-spreadsheets-ctrl-e.js
Last active January 17, 2021 12:56
GoogleスプレッドシートでCtrl + Eを使う(TamperMonkey対応)
// ==UserScript==
// @name Emacs Ctrl + E
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Enable Ctrl + E(go to end-of-line) to Google Spreadsheet
// @author Hideki Ikemoto
// @match https://docs.google.com/spreadsheets/d/*
// @grant none
// ==/UserScript==
@miyaokamarina
miyaokamarina / conditions.js
Last active March 9, 2023 15:31
Type-level conditions in Flow https://is.gd/OPsJBd
// Licensed under CC BY 4.0.
type $If<X: boolean, Then, Else = empty> = $Call<
& ((true, Then, Else) => Then)
& ((false, Then, Else) => Else),
X,
Then,
Else,
>;
@miz21358
miz21358 / template.json
Created January 16, 2018 06:35
Elasticsearch+kuromoji-neologd で品詞分解アナライザを設定したテンプレート設定用JSONファイル
{
"sample-analyze": {
"order": 0,
"template": "sample-analyze-*",
"settings": {
"index": {
"analysis": {
"filter": {
"greek_lowercase_filter": {
"type": "lowercase",
@yonglai
yonglai / playbook_centos_install_docker.yaml
Created November 15, 2017 18:04
An Ansible playbook to install docker-ce on Centos
---
- name: Install docker
gather_facts: No
hosts: default
tasks:
- name: Install yum utils
yum:
name: yum-utils
state: latest
@bomsy
bomsy / emptylines.md
Last active September 12, 2020 08:12
How do we use babel: Empty Lines

The Firefox debugger has undergone a massive rewrite in the last two years, moving away from old Mozilla-specific technologies like XUL etc, to more modern technologies like React, webpack and babel.

[Babel][babel] is a tool for compiling Javascript into Javascript. It generates an [Abstract Syntax Tree (AST)][ast_wiki] which can be transformed, transversed or manipulated in various ways for use. Babel and AST's have played a major part in growth of the modern web tooling ecosystem.

Over the past year, we have used babel extensively in building the debugger, from disabling non-executable lines so breakpoints cannot be set to highlighting out of scope code and much more.

I felt it would be nice to write a couple of blog posts, documenting some of the use cases and looking into some debugger internals as we go.

@teppeis
teppeis / es-class-fields.md
Last active March 13, 2022 13:57
ES Class Fieldsのプライベートフィールドがハッシュな変態記法なのは何でなんだぜ?

ES Class Fields (Stage 2 now)

プライベートフィールドがハッシュな変態記法なのは何でなんだぜ?

class Point {
    #x;
    #y;
 constructor(x = 0, y = 0) {
@Kcnarf
Kcnarf / .block
Last active December 3, 2018 08:19
Voronoï playground : interactive weighted Voronoï study II
license: gpl-3.0
@vlucas
vlucas / encryption.js
Last active May 17, 2024 12:11
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
@yymm
yymm / want_to_ergodox.md
Last active May 27, 2020 00:44
Ergodox買おうの会

この記事のあの画像を見てビビッと来てしまったので, 周りにいる人とErgodoxの購入検討をはじめました(随時更新)

購入できるところ

➜ FalbaTech

ErgoDox - FalbaTech

選んでいくスタイル。

@angelworm
angelworm / hoge.js
Created February 1, 2016 23:43
callback hellを避けるけど同期処理のようにもしない奴
// utility ----------------------------------------------------------
function isGenerator(o) {
return (typeof o === "object") && (typeof o.next === "function");
}
function isPromise(o) {
return (typeof o === "object") && (typeof o.then === "function");
}
function isTag(o) {
return (typeof o === "object") && (o.tag === "tag");
}