Skip to content

Instantly share code, notes, and snippets.

View list-usage.tsx
<HogeList>
<HogeList.Item title="ABC" />
<HogeList.Item title="DEF" />
</HogeList>
View list-definition.tsx
interface HogeListItemProps {
title: string;
}
const HogeListItem: React.VFC<HogeListItemProps> = ({title}) =>
<li>{title}</li>;
interface HogeListProps {
children: ReactNode;
}
@sunnyone
sunnyone / myproj.sh
Last active Dec 21, 2020
Run multiple dev server
View myproj.sh
#!/bin/bash
PROJECT_ROOT=~/proj
COMMANDS=(
myserver "bundle exec rackup"
myclient "yarn dev"
)
View gist:defc45dc1b0f2ddb12996d0b528d10fe
$ cat >user-data <<EOF
#cloud-config
hostname: cloudtest.localdomain
user: myuser
password: ubuntu
chpasswd: { expire: True }
ssh_pwauth: True
disk_setup:
/dev/vdb:
@sunnyone
sunnyone / cloud-init.log
Last active Jun 27, 2020
cloud-init on Ubuntu 20.04 fails disk_setup
View cloud-init.log
2020-06-27 13:16:19,956 - stages.py[DEBUG]: Running module disk_setup (<module 'cloudinit.config.cc_disk_setup' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_disk_setup.py'>) with frequency once-per-instance
2020-06-27 13:16:19,956 - handlers.py[DEBUG]: start: init-network/config-disk_setup: running config-disk_setup with frequency once-per-instance
2020-06-27 13:16:19,957 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/iid-local01/sem/config_disk_setup - wb: [644] 24 bytes
2020-06-27 13:16:19,957 - helpers.py[DEBUG]: Running config-disk_setup using lock (<FileLock using file '/var/lib/cloud/instances/iid-local01/sem/config_disk_setup'>)
2020-06-27 13:16:19,957 - cc_disk_setup.py[DEBUG]: Partitioning disks: {'/dev/vdb': {'layout': True, 'overwrite': False, 'table_type': 'mbr'}}
2020-06-27 13:16:19,957 - cc_disk_setup.py[DEBUG]: Creating new partition table/disk
2020-06-27 13:16:19,957 - util.py[DEBUG]: Running command ['udevadm', 'settle'] with allowed return codes [0] (shell=False, capture=T
View webpack.config.js
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
const path = require("path");
const glob = require("glob");
module.exports = {
target: "node",
entry: Object.fromEntries(
glob.sync("*/*.ts", {cwd: "src/ts/functions"})
.map((x) => [x.replace(/\.ts$/, ""), `./src/ts/functions/${x}`])),
View gist:685933737bf76a96bb16d9d1984a6647
https://github.com/supportleap/beacon/blob/def87471012168ff251c3c7797bbe6fe8930b510/lib/graph/schema.rb
https://github.com/tessalt/marmoset/blob/1aa9d16d05490441322bc8016466730839de6eba/app/graph/schema.rb
https://github.com/artsy/exchange/tree/c45262455dfa79bf8e6520f4dabac847683d78ae/app/graphql/types
@sunnyone
sunnyone / hoge.html
Created Jun 22, 2019
performance trace
View hoge.html
<html>
<head></head>
<body>
<script>
window.perf1start = performance.now();
</script>
<link rel="stylesheet" href="" />
<script>
var perf1 = performance.now() - window.perf1start;
@sunnyone
sunnyone / entrypoint.sh
Created Apr 25, 2019
Gollum entrypoint.sh
View entrypoint.sh
#!/bin/sh
cd /work
exec bundle exec bin/gollum -p 80 /wiki
View gist:d3cd8e10159c3be7792c8dc41ede193e
FROM ruby
RUN apt-get -y update && apt-get -y install libicu-dev cmake && rm -rf /var/lib/apt/lists/*
COPY . /work
RUN cd /work && bundle install --path vendor/bundle
WORKDIR /wiki
ENTRYPOINT ["/work/entrypoint.sh"]
EXPOSE 80