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 / 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 / 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 / convert-seconds-into-date-format-in-ruby.rb
Last active December 15, 2015 03:53 — forked from shunchu/convert-seconds-into-hh-mm-ss-in-ruby.rb
Convert seconds into HH:MM:SS or date format in Ruby
# seconds
t = 236
Time.at(t).utc.strftime("%H:%M:%S")
=> "00:03:56"
# unix time
t = 1450236594
Time.at(t).utc.strftime("%Y/%d/%d %H:%M:%S")
=> "03:29:54"
@moreta
moreta / gw-kit.sh
Last active August 29, 2015 14:28
kerberos 인증 및 rlogin을 위한 gateway용 스크립트
#!/bin/bash
#==============================================================================
# GW-Kit
# @author : yunsang.choi(oddpoet@gmail.com)
# @src : https://gist.github.com/gists/3115022
#-------
# v1.3.4
# - minor change (display text)
# v1.3.3
# - allow '-' character in hostname
@moreta
moreta / call_rake.rb
Last active August 29, 2015 14:14
rake run code for example from rails controller
def call_rake(task, options = {})
options[:rails_env] = Rails.env
args = options.map { |n, v| "#{n.to_s.upcase}='#{v}'" }
system "bundle exec rake #{task} #{args.join(' ')} >> #{Rails.root}/log/rake.log &"
end
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "VPC knowhow template",
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type": "String",
"MinLength": "1",
"MaxLength": "64",
"AllowedPattern": "[-_ a-zA-Z0-9]*",
require "github_api"
# スター数を知りたいリポジトリ user/name
repos = %W{
allaboutapps/A3GridTableView
AlanQuatermain/AQGridView
norsez/BDDynamicGridViewController
hirohisa/BrickView
phranck/CNGridView
gmoledina/GMGridView
@moreta
moreta / commit-msg
Last active August 29, 2015 13:57 — forked from EmmanuelOga/commit-msg
#!/usr/bin/env ruby
#
# Git commit-msg hook. If your branch name is in the form "US1234-postfix", or
# "US1234_postfix", it automatically adds the prefix "[US1234]" to commit
# messages.
#
# Example
# =======
#
# git checkout -b US1234-some-cool-feature
@moreta
moreta / tableless.rb
Created October 29, 2012 12:22 — forked from matpowel/tableless.rb
An ActiveRecord emulating Tableless model which works with Rails 3.1
class Tableless < ActiveRecord::Base
def self.column(name, sql_type = nil, default = nil, null = true)
columns << ActiveRecord::ConnectionAdapters::Column.new( name.to_s, default, sql_type.to_s, null )
end
def self.columns()
@columns ||= [];
end