Skip to content

Instantly share code, notes, and snippets.

View hmmhmmhm's full-sized avatar
๐Ÿงฏ
BURNING!!

<hmmhmmhm/> hmmhmmhm

๐Ÿงฏ
BURNING!!
View GitHub Profile
@hmmhmmhm
hmmhmmhm / carousel.html
Created October 25, 2018 12:50
WaterwheelCarousel Resize
@hmmhmmhm
hmmhmmhm / calendar.js
Created October 30, 2018 06:11
moment.js based calendar
import moment from 'moment'
class Calendar{
constructor(paramCalendarDiv, updateCallback) {
this.calendarDiv = paramCalendarDiv
this.monthPage = 0
this.activatedDay = null
this.callbacks = []
this.todayCallbacks = []
const puppeteer = require('puppeteer');
const logger = require('./logger');
const Pool = require('./pool');
const LRU = require("lru-cache");
var browserErrorCount = 0;
var collectInterval = null;
var hitInterval = null;
async function pageAccelerate(page){
@hmmhmmhm
hmmhmmhm / model.js
Last active November 21, 2019 14:17
model.js
// require('./product')
module.exports = (sequelize, DataTypes) => (
sequelize.define('product', {
codeNumber: {
type: DataTypes.STRING(50),
allowNull: false,
},
kind: {
type: DataTypes.STRING(20),
allowNull: false,
@hmmhmmhm
hmmhmmhm / index.ts
Created March 10, 2020 08:45
moment ts, typescript ํ•œ๊ตญ์–ด ์„ค์ • (๋ชจ๋ฉ˜ํŠธ ํƒ€์ž…์Šคํฌ๋žฉํŠธ ํ•œ๊ตญ์–ด ์„ค์ • ๋ฐฉ๋ฒ•)
import "moment/locale/ko"
import * as moment from 'moment'
moment.locale('ko')
console.log(moment.default().format('MM-DD ddd')) // 03-10 ํ™”
@hmmhmmhm
hmmhmmhm / iOSZoomPrevent.ts
Created March 18, 2020 08:15
iOSZoomPrevent.ts
// iOS Pinch Zoom ๋„๊ธฐ
document.documentElement.addEventListener(
'touchstart',
(event) => {
if (event.touches.length > 1) {
event.preventDefault()
}
},
false
@hmmhmmhm
hmmhmmhm / firebase-push-message-send-node-js-example.ts
Created March 31, 2020 02:14
firebase-push-message-send-node-js-example.ts
import * as FirebaseAdmin from 'firebase-admin'
import * as serviceAccount from '../~~.json'
FirebaseAdmin.initializeApp({
// @ts-ignore
credential: FirebaseAdmin.credential.cert(serviceAccount),
})
export const sendPushMessage = async (
notification: {
@hmmhmmhm
hmmhmmhm / puppeteer.ts
Last active July 9, 2020 01:04
Anti-Cloudflare Script
import puppeteer from 'puppeteer'
import puppeteerExtra from 'puppeteer-extra'
import pluginStealth from 'puppeteer-extra-plugin-stealth'
import cloudscraper from 'cloudscraper'
import {User} from "../domain/user";
import {accessing} from "../handlers/nasHandler";
let scraper: any = cloudscraper
let browser;
@hmmhmmhm
hmmhmmhm / chunk.ts
Last active June 9, 2021 06:37
Typescript (Javascript) Array Chunk Generator
export const chunk = <T>(array: T[], chunkSize: number) => {
const result: T[][] = []
for (let i = 0; i < array.length; i += chunkSize)
result.push(array.slice(i, i + chunkSize))
return result
}
/*
Windows 10 ์ผ๋ถ€ ๋ฒ„์ „ + XP๋ฒ„์ „์—์„œ JSON ํŒŒ์ผ์„ ๋ฉ”๋ชจ์žฅ์œผ๋กœ
์ˆ˜์ •ํ•œ ์‚ฌ๋žŒ์˜ ๊ฒฝ์šฐ utf8 ๋กœ ์ €์žฅํ•ด๋„ utf8 with BOM ์ด๋ผ๋Š”
ํ˜•์‹์œผ๋กœ ์ €์žฅ์ด๋˜๋Š”๋ฐ ์ดํ˜•์‹ํŠน์ดํ•œ๊ฒŒ ์ตœ์ดˆ์— ์ด์ƒํ•œ ๊ธ€์ž๋ฅผ ์ถ”๊ฐ€ํ•ด์„œ
fs ๊ฐ€ ์‚‘์‚ด๋‚˜์„œ ํ„ฐ์ง‘๋‹ˆ๋‹ค, ์ด ์˜ค๋ฅ˜๋ฅผ ์ˆ˜์ •ํ•˜๋ ค๋ฉด ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ์“ฐ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
*/
fs.readFile('./myconfig.json', 'utf8', function (err, data) {
myconfig = JSON.parse(data.toString('utf8').replace(/^\uFEFF/, ''))
})