Skip to content

Instantly share code, notes, and snippets.

View Code-Hex's full-sized avatar

Kei Kamikawa Code-Hex

View GitHub Profile
import { FC } from 'react'
type GoogleLogoProps = {
className: string
}
const GoogleLogo: FC<GoogleLogoProps> = (props: GoogleLogoProps) => {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
@Code-Hex
Code-Hex / grafana.rb
Created December 13, 2020 09:31
M1 mac arm64 Formula
class Grafana < Formula
desc "Gorgeous metric visualizations and dashboards for timeseries databases"
homepage "https://grafana.com"
url "https://github.com/grafana/grafana/archive/v7.3.5.tar.gz"
sha256 "c63cf5b24733261386777a91e34b2d7646965e4a9adcea64dca519c5bc2cbede"
license "Apache-2.0"
head "https://github.com/grafana/grafana.git"
bottle do
cellar :any_skip_relocation
@Code-Hex
Code-Hex / main.go
Created December 6, 2020 06:44
investigate memory usage
package main
/*
#cgo darwin CFLAGS: -x objective-c -fobjc-arc
#cgo darwin LDFLAGS: -lobjc -framework Foundation -framework Virtualization
# include "virtualization.h"
*/
import "C"
import (
"fmt"
@Code-Hex
Code-Hex / calendar.js
Created August 3, 2020 13:35
日めくりカレンダー
import styled from 'styled-components'
export const Calendar = ({ date }) => {
const month = ['Jan','Feb','Mar','Apr','May','June','July','Aug','Sept','Oct','Nov','Dec']
return (
<Border color="#000">
<Header>{month[6]}</Header>
<Body>25</Body>
</Border>
)
@Code-Hex
Code-Hex / .vimrc
Created May 23, 2020 13:56
vim terminal api
" https://github.com/google/vim-maktaba/blob/f630b985facf383ae1657d569ff69582224cca04/autoload/maktaba/path.vim#L9
func s:pathJoin(left, right)
if a:left =~# '\v\\@<!%(\\\\)*\zs/$'
return a:left . a:right
elseif empty(a:left)
return a:right
endif
return a:left . '/' . a:right
endfunc
@Code-Hex
Code-Hex / async.rs
Created May 18, 2020 12:50
rust 入門
use futures::future::{Abortable, AbortHandle, Aborted};
use futures::executor::block_on;
fn main() {
println!("Hello, world!");
block_on(run());
}
async fn run() {
@Code-Hex
Code-Hex / nvim_log.md
Last active April 28, 2020 14:58
neovim 調査
  • UI_BRIDGE_CALL(b, stop, 1, b);ui_bridge_stop_event を呼ぶ in ui_bridge_stop
  • ui_bridge_attachui_bridge_stop をセットしてる
  • これらを呼び出す ui_call_stopos_exit の中で呼ばれてる
@Code-Hex
Code-Hex / signal.go
Created April 25, 2020 14:03
shell 上でどんな signal を受け取ったか見る
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
)
func main() {
@Code-Hex
Code-Hex / neovim.log
Last active April 25, 2020 07:25
Investigation for why causing kernel panic by nvim on macOS
PID/THRD RELATIVE ELAPSD CPU SYSCALL(args) = return
1448/0x4271: 5073 88 2 thread_selfid(0x0, 0x0, 0x0) = 17009 0
1448/0x4271: 5171 120 53 open(".\0", 0x0, 0x1) = 3 0
1448/0x4271: 5181 12 7 fstat64(0x3, 0x7FFEDFFFDD30, 0x0) = 0 0
1448/0x4271: 5189 10 4 fcntl(0x3, 0x32, 0x7FFEDFFFE400) = 0 0
1448/0x4271: 5196 9 5 close(0x3) = 0 0
1448/0x4271: 5236 43 39 stat64("/Users/codehex/go/src/github.com/neovim/neovim\0", 0x7FFEDFFFDCA0, 0x0) = 0 0
1448/0x4271: 5256 8 5 __mac_syscall(0x114943C3F, 0x5A, 0x7FFEDFFFDF00) = 0 0
1448/0x4271: 5289 5 1 shared_region_check_np(0x7FFEDFFFDD68, 0x0, 0x0) = 0 0
1448/0x4271: 5301 10 8 stat64("/private/var/db/dyld/dyld_shared_cache_x86_64h\0", 0x7FFEDFFFDCB0, 0x0) = 0 0
const { IncomingWebhook } = require('@slack/webhook');
const url = process.env.SLACK_WEBHOOK_URL;
const webhook = new IncomingWebhook(url);
// subscribeSlack is the main function called by Cloud Functions.
module.exports.subscribeSlack = (pubSubEvent, context) => {
const build = eventToBuild(pubSubEvent.data);
// Skip if the current status is not in the status list.