This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: use asroot; # run it as root | |
package asroot; | |
use strict; | |
use warnings; | |
# TODO: inherits @INC | |
exec "sudo", $^X, $0, @ARGV if $< != 0; | |
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/config/webpack.config.js b/config/webpack.config.js | |
index 601977b04..63866d814 100644 | |
--- a/config/webpack.config.js | |
+++ b/config/webpack.config.js | |
@@ -37,11 +37,16 @@ const publicPath = (() => { | |
const DAY_MS = 24 * 60 * 60 * 1000; | |
const ASSET_EXPIRED_TIME_MS = Date.now() - 14 * DAY_MS; // 14 days ago | |
+// filter core-js modules instead of just using "core-js" to reduce bundle sizes | |
+const coreJsModules = require("core-js-compat")({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: use the last segment of the result CSV | |
/* eslint-disable no-console */ | |
import { utf8EncodeJs, utf8Count, utf8DecodeJs, utf8DecodeTD } from "../src/utils/utf8"; | |
import { utf8DecodeWasm } from "../src/wasmFunctions"; | |
// @ts-ignore | |
import Benchmark from "benchmark"; | |
for (const baseStr of ["A"]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
const assert = require("assert"); | |
const jsonBuffer = fs.readFileSync("./schema.json"); | |
const object = JSON.parse(jsonBuffer.toString()); | |
const jsonParseExpr = `(JSON.parse(${JSON.stringify(JSON.stringify(object))}))`; | |
const objectLiteralExpr = `(${JSON.stringify(object)})`; | |
const N = 100; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for Rails v5.2 + msgpack-ruby v1.3 | |
MessagePack::DefaultFactory.register_type( | |
MessagePack::Timestamp::TYPE, | |
ActiveSupport::TimeWithZone, | |
packer: -> (time) do | |
MessagePack::Timestamp.to_msgpack_ext(time.tv_sec, time.tv_nsec) | |
end, | |
unpacker: -> (payload) do | |
tv = MessagePack::Timestamp.from_msgpack_ext(payload) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Experimental `push(...bytes)`-able buffer | |
// Unfortunately, it is always slower than Array<number>. | |
export class MutableBuffer { | |
private length = 0; | |
private buffer = new Uint8Array(32); | |
push(...bytes: ReadonlyArray<number>): void { | |
const newLength = this.length + bytes.length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rules: | |
- id: kibela.connection_type_without_resolver | |
pattern: "field(:symbol:, _.connection_type, ..., !resolve: _, ...)" | |
message: "Relay connection に resolver が設定されていません。 AR::Relation に対するconnectionは resolver でソートを指定すべきです。" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usage: | |
// findChildRecursively(this.props.children, (child) => { | |
// return React.isValidElement(child) && child.type === "a"; | |
// }); | |
export function findChildRecursively( | |
children: React.ReactNode | ReadonlyArray<React.ReactNode>, | |
predicate: (child: React.ReactChild) => boolean, | |
): boolean { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
module Types | |
class CountableObject < BaseObject | |
class << self | |
def define_connection(**args, &block) | |
super(**args) do | |
block&.call | |
# this type must be GraphQL::INT_TYPE (not Integer), may be a bug. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
extends: [ | |
// https://eslint.org/docs/rules/ | |
"eslint:recommended", | |
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/configs/recommended.json | |
"plugin:@typescript-eslint/recommended", | |
// https://prettier.io/docs/en/eslint.html | |
"plugin:prettier/recommended", | |
// https://github.com/yannickcr/eslint-plugin-react | |
"plugin:react/recommended", |