Skip to content

Instantly share code, notes, and snippets.

import * as Rx from 'rxjs';
import * as RxOp from 'rxjs/operators';
Rx.fromEvent(document, 'click')
.pipe(
// Choose One
// RxOp.mergeMap(() => Rx.interval(1000)),
// RxOp.switchMap(() => Rx.interval(1000)),
)
.subscribe(value => console.log(value));
@kuroneko0441
kuroneko0441 / TitleBar.css
Last active November 15, 2018 19:08
Electron TitleBar
.eletron-titlebar {
display : block;
position : fixed;
top : 0;
width : 100%;
height : 32px;
color : white;
background : #254053;
module.exports = (tokens, req, res) => {
const date = new Date();
const timezoneOffset = date.getTimezoneOffset() * 60000;
const dateWithTimezone = new Date(date.getTime() - timezoneOffset).toISOString().substring(0, 19).replace("T", " ");
const timezone = date.toString().split(" ")[5];
let statusWIthColor = "";
switch (tokens["status"](req, res).substring(0, 1)) {
case "1":
@kuroneko0441
kuroneko0441 / Logger.ts
Last active September 21, 2018 20:51
사용법
import * as express from "express";
import {TokenIndexer} from "morgan";
import * as colors from "colors";
import {appendFileSync} from "fs";
import {join} from "path";
export namespace Logger {
export const getDate = (): string => {
const date = new Date();
return colors.magenta("[" +
<!DOCTYPE HTML>
<html>
<head>
<style>
.big-box {
height: 100vh;
}
</style>
</head>
<body>
@kuroneko0441
kuroneko0441 / ImageConvertor.cs
Last active March 22, 2021 01:57
C# 이미지 리사이즈(비율 유지)
using System;
using System.Drawing;
namespace ImageConvertor {
class ImageConvertor {
/**
* <summary>
* 이미지를 targetX, targetY로 리사이징함. 비율은 유지하고 빈 공간은 검은색으로 채움
* </summary>