Skip to content

Instantly share code, notes, and snippets.

View nayunhwan's full-sized avatar
👨‍🎨
Artistic Programmer

Yunhwan Logan Na nayunhwan

👨‍🎨
Artistic Programmer
View GitHub Profile
@nayunhwan
nayunhwan / random.js
Created June 28, 2019 04:57
Random Class Timetable
// 1~90 번호 생성기
const subjectNumbers = Array.from(Array(90).keys()).map((number) => number + 1);
const timetableGenerator = () => {
// 빈 배열 생성기 -> 할당되지 않은 과목번호는 0
const times = new Array(7);
for (let i = 0; i < times.length; i++) {
times[i] = Array.from(new Array(10)).map(() => 0);
}
return times;
};
@nayunhwan
nayunhwan / uuidGenerator.js
Last active October 18, 2018 02:10
Generate UUID - JavaScript
function create_UUID(){
var dt = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = (dt + Math.random()*16)%16 | 0;
dt = Math.floor(dt/16);
return (c=='x' ? r :(r&0x3|0x8)).toString(16);
});
return uuid;
}
@nayunhwan
nayunhwan / vscode.setting
Last active July 30, 2018 06:35
Visual Studio Setting
{
"workbench.colorTheme": "Atom One Dark",
"atomKeymap.promptV3Features": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"prettier.eslintIntegration": true,
"eslint.autoFixOnSave": true,
"tslint.autoFixOnSave": true,
@nayunhwan
nayunhwan / TickingClockWithComponent_index.js
Created December 29, 2016 07:07
React Ticking Clock with Component index.js
ReactDOM.render(
<Clock />,
document.getElementById('root')
);
@nayunhwan
nayunhwan / TickingClockWithComponent.js
Created December 28, 2016 07:44
React Example TickingClock with Comopnent
function Clock(props) {
return (
<div>
<h1>Hello, world!</h1>
<h2>It is {props.date.toLocaleTimeString()}.</h2>
</div>
);
}
function tick() {
@nayunhwan
nayunhwan / ExtractingComponent.js
Created December 28, 2016 07:08
React Extracting Component Example
function Comment(props) {
return (
<div className="Comment">
<div className="UserInfo">
<img className="Avatar"
src={props.author.avatarUrl}
alt={props.author.name}
/>
<div className="UserInfo-name">
{props.author.name}
@nayunhwan
nayunhwan / ComposingComponent.js
Created December 28, 2016 07:04
React Composing Component Example
function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
function App() {
return (
<div>
<Welcome name="Sara" />
<Welcome name="Cahal" />
<Welcome name="Edite" />
function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
function App() {
return (
<div>
<Welcome name="Sara" />
<Welcome name="Cahal" />
<Welcome name="Edite" />
class Welcome extends React.Component {
render() {
return <h1>Hello, {this.props.name}</h1>;
}
}
@nayunhwan
nayunhwan / HelloWorld.js
Created December 27, 2016 16:57
Rendering "Hello, World!" in React
// This is index.js written by JSX
const element = <h1>Hello, world</h1>;
ReactDOM.render(
element,
document.getElementById('root')
);