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 en = ["\"", "'", ",", ".", "?", "!", "(", ")", "[", "]", "{", "}", ";"]; | |
const cn = ["“", "‘", ",", "。", "?", "!", "(", ")", "【", "】", "「", "」", ";"]; | |
const converter = (source, from, target) => { | |
const map = new Map(from.map((item, index) => [item, target[index]])); | |
return source.split('').map(item => map.get(item) || item).join('') | |
}; | |
export const cn2enSymbol = (source) => converter(source, cn, en); | |
export const en2cnSymbol = (source) => converter(source, en, cn); |
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
#add 'node_modules' to .gitignore file | |
git rm -r --cached node_modules | |
git commit -m 'Remove the now ignored directory node_modules' | |
git push origin master |
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 React = require('react'); | |
var EventListener = require('react/lib/EventListener'); | |
var partition = require('linear-partitioning'); | |
var TileLayout = React.createClass({ | |
getDefaultProps: function() { | |
return { | |
gutter: 0, | |
photos: [] | |
} |
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
import sublime | |
import sublime_plugin | |
import re | |
class CompactExpandCssCommand(sublime_plugin.TextCommand): | |
def run(self, edit, action='compact'): | |
rule_starts = self.view.find_all('\{') | |
rule_ends = self.view.find_all('\}') |