Skip to content

Instantly share code, notes, and snippets.

View RyanKor's full-sized avatar
🎯
Focusing

SeungTaeKim RyanKor

🎯
Focusing
View GitHub Profile
@RyanKor
RyanKor / hashtag.js
Created October 24, 2020 18:33
Hashtag.js setting
module.exports = (sequelize, DataTypes) =>
sequelize.define(
"hashtag",
{
title: {
type: DataTypes.STRING(15),
allowNull: false,
unique: true,
},
},
@RyanKor
RyanKor / post.js
Created October 24, 2020 18:34
post.js setting
module.exports = (sequelize, DataTypes) =>
(sequelize.define(
"post",
{
content: {
type: DataTypes.STRING(140),
allowNull: false,
},
img: {
type: DataTypes.STRING(200),
@RyanKor
RyanKor / post.js
Last active October 24, 2020 18:40
Hash Tag Controller/post.js
const { Post, Hashtag } = require("../models");
exports.textUpload = async (req, res, next) => {
try {
const post = await Post.create({
content: req.body.content,
img: req.body.url,
userId: req.user.id,
});
const hashtags = req.body.content.match(/#[^\s#]*/g);
@RyanKor
RyanKor / main.pug
Created October 24, 2020 18:50
Main page for hash tag
extends layout
block content
if user
.twits
form#hashtag-form(action='/post/hashtag')
input(type='text' name='hashtag' placeholder='Tag Search')
button.btn Search
form#sns-form(action='/post' method='POST' enctype='multipart/form-data')
.sns-discription post content
@RyanKor
RyanKor / post.js
Created October 24, 2020 18:52
router/post.js
const express = require("express");
const router = express.Router();
const postController = require("../controllers/post");
router.post("/", postController.textUpload);
router.get("/hashtag", postController.hashtagSearch);
@RyanKor
RyanKor / I'm a night 🦉
Last active September 25, 2021 00:12
I'm a night 🦉
🌞 Morning 49 commits ██▎░░░░░░░░░░░░░░░░░░ 10.7%
🌆 Daytime 110 commits █████░░░░░░░░░░░░░░░░ 24.1%
🌃 Evening 180 commits ████████▎░░░░░░░░░░░░ 39.4%
🌙 Night 118 commits █████▍░░░░░░░░░░░░░░░ 25.8%
@RyanKor
RyanKor / SeungTaeKim's GitHub Stats
Last active September 24, 2021 12:06
SeungTaeKim's GitHub Stats
⭐ Total Stars: 13
➕ Total Commits: 847
🔀 Total PRs: 215
🚩 Total Issues: 296
📦 Contributed to: 3
@RyanKor
RyanKor / label.py
Created September 6, 2021 12:20
Fluent Python
a = [1,2,3]
b = a
a.append(4)
print(b) # result : [1,2,3,4]
class Gizmo:
def __init__(self):
print("Gizmo id: %d" % id(self))
x = Gizmo()
# Gizmo id : 4301489152
y = Gizmo() * 10
# Gizmo id : 4301489432
class HauntedBus:
def __init__(self, passengers=[]):
self.passengers = passengers
def pick(self, name):
self.passengers.append(name)
def drop(self, name):
self.passengers.remove(name)