This file contains hidden or 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
'default import': | |
'prefix': 'impDefault' | |
'body': 'import ${1:defaultMember} from \'${2:module-name}\'' | |
'named import': | |
'prefix': 'impNamed' | |
'body': 'import { ${1:namedMember} } from \'${2:module-name}\'' | |
'export default': | |
'prefix': 'expDefault' | |
'body': 'export default ${1:name}' | |
'export': |
This file contains hidden or 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
'snippet block': | |
'prefix': 'snippet' | |
'body': """ | |
\'${1:Snippet Name}\': | |
\'prefix\': \'${2:Snippet Shortcut}\' | |
\'body\': \'${3:Snippet}\' | |
""" |
This file contains hidden or 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
'configure store': | |
'prefix': 'rdStore' | |
'body': """ | |
export default function configureStore(preloadedState) { | |
return createStore( | |
rootReducer, | |
preloadedState, | |
applyMiddleware( | |
$1 | |
) |
This file contains hidden or 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
'JSX comment': | |
'prefix': 'reJSXComment' | |
'body': '{/* ${1:Comments...} */}' | |
'ReactDOM.render': | |
'prefix': 'reDOMRender' | |
'body': 'ReactDOM.render(${1:<App />}, document.getElementById(\'${2:root}\'));' | |
'class component w/ extras': | |
'prefix': 'reCompFull' | |
'body': """ | |
class ${1:Component} extends React.Component { |
This file contains hidden or 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 pigLatin = str => { | |
let pigStr = ""; | |
const key = ["a", "e", "i", "o", "u"]; | |
if (key.some(val => val === str.charAt(0))) { | |
pigStr = str + "way"; | |
return pigStr; | |
} else { | |
pigStr = str.slice(1) + str.charAt(0) + "ay"; | |
return pigStr; | |
} |
This file contains hidden or 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
var romanize = function(num) { | |
var rom = { | |
M: 1000, | |
CM: 900, | |
D: 500, | |
CD: 400, | |
C: 100, | |
XC: 90, | |
L: 50, | |
XL: 40, |
This file contains hidden or 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
var deromanize = function(str) { | |
var str = str.toUpperCase(), | |
validator = /^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/, | |
token = /[MDLV]|C[MD]?|X[CL]?|I[XV]?/g, | |
key = { | |
M: 1000, | |
CM: 900, | |
D: 500, | |
CD: 400, | |
C: 100, |
NewerOlder