Skip to content

Instantly share code, notes, and snippets.

View moreta's full-sized avatar

JungJoo Seo moreta

  • Brakio
  • Japan
View GitHub Profile
@moreta
moreta / member_id_hmac_hashing.rb
Created June 10, 2022 06:34
channel talk HMAC Hashing ruby
member_id = 'lucas';
secret_key = '4629de5def93d6a2abea6afa9bd5476d9c6cbc04223f9a2f7e517b535dde3e25';
expected_hash = "99427c7bba36a6902c5fd6383f2fb0214d19b81023296b4bd6b9e024836afea2";
key = ['4629de5def93d6a2abea6afa9bd5476d9c6cbc04223f9a2f7e517b535dde3e25'].pack('H*')
OpenSSL::HMAC.hexdigest("SHA256", key, member_id)
@moreta
moreta / UseEventLoadingSample.vue
Last active May 20, 2020 07:35
Event loading sample code for Vue Composition Api
<template>
<section class="main">
<v-overlay :value="eventLoading">
<v-progress-circular indeterminate size="64"></v-progress-circular>
</v-overlay>
<v-btn @click="handleSubmit">SUBMIT</v-btn>
</section>
</template>
@moreta
moreta / Dockerfile
Created March 21, 2020 15:53 — forked from RoyalIcing/Dockerfile
Rails 5.1 Dockerfile
FROM ruby:2.4-alpine
ENV PATH /root/.yarn/bin:$PATH
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh build-base nodejs tzdata
RUN apk update \
&& apk add curl bash binutils tar gnupg \
&& rm -rf /var/cache/apk/* \
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<div class="section">
<el-input type="text" v-model="input" auto-complete="off" style="width:80%;"></el-input>
</div>
<div class="section">
<el-button type="button" @click="send">SEND</el-button>
<el-button type="button" @click="disconnect">DISCONNECT</el-button>
</div>
@moreta
moreta / ratio-media.css
Created December 18, 2019 04:20
ratio media - image, video
.ratio {
position: relative;
width: 100%;
overflow: hidden;
&:before {
content: "";
display: block;
padding-top: 75%; /* 4:3 - 75%, 3:4 - 133.33%, 16:9 - 56.25% , 3:2 - 66.66%, 8:5 - 62.5% */
}
@moreta
moreta / RefreshLink.vue
Last active May 16, 2019 03:42
Workaround vue router-link current path click no action (router-linkのcurrent pathの無反応回避策)
@moreta
moreta / Demo.vue
Created February 25, 2019 16:18 — forked from Akryum/Demo.vue
vue-responsive
<template>
<div>
<div v-if="$responsive.mobile">Mobile</div>
<div v-else-if="$responsive.tablet">Tablet</div>
<div v-else>Desktop</div>
</div>
</template>
@moreta
moreta / App.vue
Created January 18, 2019 09:53
vue fetch error handling with event bug
<template>
<transition enter-active-class="animated fadeIn">
<router-view></router-view>
</transition>
</template>
<script>
import notifyError from 'path/utils/common/notifyError'
import { MessageBox } from 'element-ui'
import EventBus from 'path/event-bus'
@moreta
moreta / v-jp-model
Created November 22, 2018 03:51
vue 日本語入力 input model binding
// japanese input
var vCompositionModelUpdate = function (el, binding, vnode) {
vnode.context[binding.expression] = el.value
}
Vue.directive('jp-model', {
bind: function (el, binding, vnode) {
el.value = binding.value
el.addEventListener('keyup', vCompositionModelUpdate.bind(this, el, binding, vnode))
@moreta
moreta / file_string_io.rb
Created November 15, 2018 06:37
ruby image base64 string upload to s3
class CustomFileStringIO < StringIO
def initialize(*args)
super(*args[1..-1])
@file_name = args[0]
end
def original_filename
@file_name
end
end