Skip to content

Instantly share code, notes, and snippets.

View supernovel's full-sized avatar

supernovel

  • Lucentblock
  • South Korea
View GitHub Profile
@supernovel
supernovel / main.dart
Last active September 1, 2022 06:44
riverpod example
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
// rivderpod 스코프 정의
runApp(ProviderScope(child: MyApp()));
}
@supernovel
supernovel / main.ts
Created August 11, 2022 07:36
커밋에 있는 지라 이슈를 기반으로 변경 사항 내용을 만든다.
import "https://deno.land/x/dotenv@v3.2.0/load.ts";
import * as Line from "https://deno.land/x/line@v1.0.1/mod.ts";
import uniq from "https://esm.sh/lodash@4.17.21/uniq?no-dts";
import lodashGet from "https://esm.sh/lodash@4.17.21/get?no-dts";
import * as log from "https://deno.land/std/log/mod.ts";
import { render } from "https://deno.land/x/mustache_ts@v0.4.1.1/mustache.ts";
await log.setup({
handlers: {
stringFmt: new log.handlers.FileHandler("DEBUG", {
@supernovel
supernovel / main.dart
Created December 2, 2021 11:03
Counter
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@supernovel
supernovel / scroll-restoration.js
Last active December 23, 2019 02:06
페이지 스크롤 저장 및 복구 (window.history 사용)
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.ScrollRestoration = factory());
}(this, (function () { 'use strict';
const SCROLL_RESTORATION_TIMEOUT_MS = 3000;
const TRY_TO_SCROLL_INTERVAL_MS = 50;
const disabled = window.history == null;
@supernovel
supernovel / horizontal_line_border.dart
Last active January 16, 2020 05:58
Horizontal line input border
import 'dart:math' as math;
import 'package:flutter/material.dart';
class HorizontalLineBorder extends InputBorder {
const HorizontalLineBorder({
BorderSide borderSide = const BorderSide(),
this.borderRadius = const BorderRadius.only(),
}) : assert(borderRadius != null),
super(borderSide: borderSide);
@supernovel
supernovel / dots_indicator.dart
Last active January 16, 2020 05:58
DotsIndicator
import 'package:flutter/material.dart';
class DotsIndicator extends StatelessWidget {
DotsIndicator(
{this.notifier,
this.itemCount,
this.onPageSelected,
this.color = Colors.white,
this.seletedColor = Colors.white,
this.dotSize = 8.0,
@supernovel
supernovel / line_text.dart
Created October 2, 2019 15:16
flutter line text
import 'package:flutter/material.dart';
import 'package:flutter/semantics.dart';
class LineText extends CustomPainter {
final String text;
final TextStyle style;
final double padding;
final Color strokeColor;
final double strokeWidth;
final Alignment alignment;
@supernovel
supernovel / outline_label_box.dart
Created October 2, 2019 14:59
flutter outline label box
import 'package:flutter/material.dart';
import 'dart:math' as math;
import 'package:flutter/semantics.dart';
class OutlineLabelBox extends CustomPainter {
final String labelText;
final TextStyle labelStyle;
final double labelPadding;
final Color strokeColor;
@supernovel
supernovel / InfiniteScroller.vue
Last active September 21, 2019 13:56
Vue Infinity Scroll
<template lang="pug">
.dataLoader
.loadingHeader(:style="{ height: pullHeight + 'px' }" v-show="PULL_DOWN === pull.type")
.headerText(v-show="!pull.available")
slot(:name="PULL_DOWN + '-before'"): span.defaultText Pull down
.headerText(v-show="pull.available & PULL_DOWN !== loadingType")
slot(:name="PULL_DOWN + '-ready'"): span.defaultText Pull down ready
.headerText(v-show="PULL_DOWN === loadingType")
slot(:name="PULL_DOWN + '-loading'"): span.defaultText Loading
.loadingContent
@supernovel
supernovel / ObjectUtil.java
Created August 20, 2019 06:58
java merge properties
package com.pixup.admin.common.util;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.function.Predicate;
import javax.annotation.Nullable;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.FatalBeanException;