Skip to content

Instantly share code, notes, and snippets.

View cereme's full-sized avatar
🔥

Sangyun Pae cereme

🔥
View GitHub Profile
@cereme
cereme / index.html
Last active May 28, 2019 14:56
Vue in Flask
<script type="text/javascript" src="{{ url_for('static', filename='main.js') }}"></script></body>
@cereme
cereme / global.js
Created May 29, 2019 03:36
My Global state management
class GlobalState{
constructor(){
this.foo = true;
this.observers = [];
}
_mutateFoo(foo){
this.foo = foo;
for(let component of this.observers){
component.setState({foo: this.foo});
@cereme
cereme / alignItems
Last active July 6, 2019 02:13
alignItems.js
//얼라인아이템즈
const alignItems =
(items) => items.filter(item => item.age < 19);
@cereme
cereme / inline.js
Created June 29, 2019 11:49
youtube api get assignable categories
const your_api_key = "";
const region_code = "kr";
fetch(`https://www.googleapis.com/youtube/v3/videoCategories?part=snippet&regionCode=${region_code}&key=${your_api_key}`,{method:'get'})
.then(res=>res.json())
.then(res=>res.items.filter(e=>e.snippet.assignable).forEach(e=>console.log(e.id, e.snippet.title)));
/*
1 Film & Animation
2 Autos & Vehicles
10 Music
15 Pets & Animals
@cereme
cereme / add_repo_to_sourcerer.sh
Created July 27, 2019 08:46
add_repo_to_sourcerer.sh
#!/bin/bash
array=($(ls -d */))
for elem in ${array[@]}; do
sourcerer add ./${elem}
done
@cereme
cereme / 1st.html
Created July 30, 2019 04:55 — forked from HelloKS/1st.html
KT ISP router usage find logic
<meta http-equiv="refresh"content="2;url=http://접속URL/?"/>
<iframe id="f"frameborder="0"style="width:1;height:1"></iframe>
<script>document.getElementById("f").src="http://KT서버/tm/?a=FF&b=WIN&c=고유값&d=고유값&e=고유값&f=고유값&g=고유값&h="+Date.now()+"&y=0&z=0&x=1&w=2018-01-03&in=고유값&id=20180123"</script>
@cereme
cereme / object_comparer.js
Last active August 27, 2019 07:57
object_comparer.js
const object_comparer = (a, b, items) => {
return items.every(item => a[item] === b[item]);
}
const items = ['a', 'b'];
const q = { a: 1, b: 2 };
const w = { a: 1, b: 2 };
const e = { a: 1, b: 3 };
console.log(object_comparer(q, w, items));
@cereme
cereme / sourcerer-add.sh
Created September 27, 2019 06:50
Add directories to sourcerer
#!/bin/bash
array=($(ls -d */))
for elem in ${array[@]}; do
sourcerer add ./${elem}
done
@cereme
cereme / App.tsx
Created October 19, 2019 14:23
Antdesign-export-strategy
import * as React from 'react';
import { Input } from 'antd';
const { TextArea } = Input;
export default function App(){
return (
<TextArea/>
<Input.TextArea/>
)
@cereme
cereme / HtmlClipboard.py
Created March 26, 2020 06:33
Copy HTML to clipboard in Windows32
"""
https://stackoverflow.com/a/60024346/6521523
Edit on Jan 02, 2020
@author: the_RR
Adapted for python 3.4+
Requires pywin32
original: http://code.activestate.com/recipes/474121/
# HtmlClipboard
# An interface to the "HTML Format" clipboard data format