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 scale(n){ | |
if(n === 0) return 1; | |
if(n === 1) return 1.618; | |
if(n === -1) return 0.618; | |
if(n > 0){ | |
return scale(n-1) + scale(n-2); | |
} | |
if(n < 0){ | |
return scale(n+2) - scale(n+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
@function scaleMath($n) { | |
@if $n == 0 {@return 1;} | |
@if $n == 1 {@return 1.618;} | |
@if $n == -1 {@return 0.618;} | |
@if $n > 0{ | |
@return scaleMath($n - 1) + scaleMath($n - 2); | |
} | |
@if $n < 0 { | |
@return scaleMath($n + 2) - scaleMath($n + 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
const curry = require('lodash/curry'); | |
const spliter = curry((separateTo,sign,string) => { | |
string = string.split(''); | |
return string.reduce((comb,current,i) => | |
((i+1) % separateTo === 0 && (i + 1) !== string.length) | |
? comb + current + sign | |
: comb + current | |
)}); |
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 normalizeDependOn(key, id) { | |
var depend = id || "id"; | |
return key.reduce(function(data,oldData) { | |
data[oldData[depend]] = oldData; | |
return data; | |
},{}); | |
} | |
var data = { |
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 StringFarsiMonthes = (str) => { | |
switch (str) { | |
case "۱": | |
return 'فروردین'; | |
case "۲": | |
return 'اردیبهشت'; | |
case "۳": | |
return 'خرداد'; | |
case "۴": | |
return 'تیر'; |
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 coroutine = require('./coroutine'); | |
var arr = [1,2,3,4,5,6,7,8,9,10]; | |
function reader(target, i) { | |
target.next(i); | |
}; | |
const arrConsumer = coroutine(function* (target) { | |
try { |
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 DynamicRender extends Component { | |
constructor() { | |
super(); | |
this.state = { | |
foolks: [], | |
}; | |
} | |
componentWillMount() { | |
components.map((cmp) => { | |
import(/* webpackMode: "eager" */ `containers/${cmp}/index`) |
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
{ | |
"editor.formatOnSave": false, | |
"[typescriptreact]": { | |
"editor.formatOnSave": true | |
}, | |
"[typescript]": { | |
"editor.formatOnSave": true | |
} | |
} |
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
@(connect(null, mapDispatchToProps) as any) |
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 React, { Component } from 'react'; | |
import Fetch from '../Utilities/fetch'; | |
import List from './render-list'; | |
import WithLoading from './handle-loading'; | |
const ListWithLoading = WithLoading(List); | |
class FetchinUserInfo extends Component { | |
constructor(props) { | |
super(props); |
OlderNewer