This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function forFn(n) { | |
if(n === 0) return 1; | |
var a = 1; | |
for(var i = 0; i<n; i++) a = a * 2 | |
return a | |
} | |
function recursiveFn(n, m) { | |
if(!m) return factRecursive(n, 1) | |
if(n === 0) return m; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun fiboRecursive(v:Int): Int = | |
if(v <= 2) 1 | |
else fiboRecursive(v-1) + fiboRecursive(v-2) | |
fun fiboLoop(v:Int): Int { | |
if(v <= 2) return 1 | |
var result = 0 | |
var prev1 = 1 | |
var prev2 = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Java | |
interface Source<T> { | |
T next(); | |
} | |
void demo(Source<String> strs) { | |
Source<? extends Object> objects = strs; | |
} | |
// @Kotlin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
public class Test { | |
static class Creature {} | |
static class Animal extends Creature {} | |
static class Person extends Animal {} | |
static class Singer extends Person {} | |
static class GirlGroup extends Singer {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.javarouka.gist.pattern; | |
import lombok.extern.slf4j.Slf4j; | |
@Slf4j | |
public class SingletonLayholder { | |
static { | |
log.debug("SingletonLayholder initialized"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*eslint no-console:0 */ | |
import React from 'react'; | |
const DEFAULT_STYLE = 'font-weight:bold; color:'; | |
const PREV_STATE_STYLE = `${DEFAULT_STYLE}gray`; | |
const ACTION_STYLE = `${DEFAULT_STYLE}blue`; | |
const NEXT_STATE_STYLE = `${DEFAULT_STYLE}green`; | |
const showLog = (message, params, styles) => console.log(`%c${message}`, styles, params); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SomeContainer extends Component { | |
state = { value: '' }; | |
changeText = (e) => this.setState({ | |
value: e.target.value | |
}); | |
componentDidMount() { | |
this.props.findOrder({ orderId: 100012134 }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Test = (_ => { | |
const weakMap = new WeakMap(); | |
return class { | |
constructor() { | |
weakMap.set(this, _=> console.log('test')) | |
} | |
doMethod() { | |
weakMap.get(this)(); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Diff extends React.Component { | |
constructor(props) { | |
super(props); | |
this.name = "HaHa!" | |
} | |
handleArrow = () => { | |
console.log(this.name); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { injectReducer } from 'store/createRootReducer' | |
const appendReducer = (store, key, reducerModule) => { | |
const reducer = reducerModule.default || reducerModule; | |
injectReducer(store, { key, reducer }); | |
}; | |
// TODO: 계층형 라우팅 추가 필요 | |
export const routes = [ | |
{ |
NewerOlder