Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍🎨
Artistic Programmer

Yunhwan Logan Na nayunhwan

👨‍🎨
Artistic Programmer
View GitHub Profile
@nayunhwan
nayunhwan / random.js
Created Jun 28, 2019
Random Class Timetable
View random.js
// 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 Oct 18, 2018
Generate UUID - JavaScript
View uuidGenerator.js
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 Jul 30, 2018
Visual Studio Setting
View vscode.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 Dec 29, 2016
React Ticking Clock with Component index.js
View TickingClockWithComponent_index.js
ReactDOM.render(
<Clock />,
document.getElementById('root')
);
@nayunhwan
nayunhwan / TickingClockWithComponent.js
Created Dec 28, 2016
React Example TickingClock with Comopnent
View TickingClockWithComponent.js
function Clock(props) {
return (
<div>
<h1>Hello, world!</h1>
<h2>It is {props.date.toLocaleTimeString()}.</h2>
</div>
);
}
function tick() {
@nayunhwan
nayunhwan / ExtractingComponent.js
Created Dec 28, 2016
React Extracting Component Example
View ExtractingComponent.js
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 Dec 28, 2016
React Composing Component Example
View ComposingComponent.js
function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
function App() {
return (
<div>
<Welcome name="Sara" />
<Welcome name="Cahal" />
<Welcome name="Edite" />
View ComposingComponent.js
function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
function App() {
return (
<div>
<Welcome name="Sara" />
<Welcome name="Cahal" />
<Welcome name="Edite" />
View ClassComponent.js
class Welcome extends React.Component {
render() {
return <h1>Hello, {this.props.name}</h1>;
}
}
@nayunhwan
nayunhwan / HelloWorld.js
Created Dec 27, 2016
Rendering "Hello, World!" in React
View HelloWorld.js
// This is index.js written by JSX
const element = <h1>Hello, world</h1>;
ReactDOM.render(
element,
document.getElementById('root')
);