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
| // Edit /etc/default/locale | |
| LANG="en_US.UTF-8" | |
| LANGUAGE="en_US" | |
| LC_ALL="en_US.UTF-8" |
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
| // ES6 | |
| class Tweet { | |
| constructor (doc) { | |
| _.extend(this, doc); | |
| } | |
| } | |
| Tweets = new Mongo.Collection('tweets', { | |
| transform (doc) { | |
| return new Tweet(doc); |
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 map; | |
| var mode; | |
| var address; | |
| var coords; | |
| function initMap() { | |
| setTimeout(function(){ | |
| var directionsService = new google.maps.DirectionsService; | |
| var directionsDisplay = new google.maps.DirectionsRenderer; | |
| var customMapType = new google.maps.StyledMapType([ |
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
| defaults write com.apple.dock persistent-apps -array-add '{tile-data={};tile-type="spacer-tile";}'; killall Dock |
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
| cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys' |
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 uniqEs6 = (arrArg) => { | |
| return arrArg.filter ( (elem, pos, arr) => arr.indexOf (elem) == pos) | |
| } | |
| // или | |
| const uniqEs6 = (array) => [ ...new Set (array) ] |
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
| .example:lang(ru) { | |
| /* styles for ru locale */ | |
| } |
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 MODULE_DIR = /(.*([\/\\]node_modules|\.\.)[\/\\](@[^\/\\]+[\/\\])?[^\/\\]+)([\/\\].*)?$/g; | |
| { | |
| loader: 'babel-loader', | |
| test: /\.jsx?$/, | |
| include(filepath) { | |
| if (filepath.split(/[/\\]/).indexOf('node_modules')===-1) return true; | |
| let pkg, manifest = path.resolve(filepath.replace(MODULE_DIR, '$1'), 'package.json'); | |
| try { pkg = JSON.parse(fs.readFileSync(manifest)); } catch (e) {} | |
| return !!(pkg.modules || pkg['jsnext:main']); |
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
| du -h --max-depth=1 /dir |
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
| // Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
| // Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
| var FORMAT_ONELINE = 'One-line'; | |
| var FORMAT_MULTILINE = 'Multi-line'; | |
| var FORMAT_PRETTY = 'Pretty'; | |
| var LANGUAGE_JS = 'JavaScript'; | |
| var LANGUAGE_PYTHON = 'Python'; |