Save file even if it was opened without write permissions
:w !sudo tee %
Write/append lines from file to another file (optionally overwrite)
:5,25w [!] [>>] new_file
| # Linux/arm 3.18.11-hypriotos Kernel Configuration | # Linux/arm 3.18.11 Kernel Configuration | |
| CONFIG_HAVE_ARCH_AUDITSYSCALL=y | --------------------------------------------- | |
| # CONFIG_AUDITSYSCALL is not set | --------------------------------------------- | |
| CONFIG_CPUSETS=y | # CONFIG_CPUSETS is not set | |
| CONFIG_PROC_PID_CPUSET=y | --------------------------------------------- | |
| CONFIG_MEMCG_SWAP=y | # CONFIG_MEMCG_SWAP is not set | |
| CONFIG_MEMCG_SWAP_ENABLED=y | --------------------------------------------- | |
| CONFIG_CGROUP_PERF=y | # CONFIG_CGROUP_PERF is not set | |
| CONFIG_UPROBES=y | # CONFIG_UPROBES is not set | |
| CONFIG_HAVE_ARCH_SECCOMP_FILTER=y | --------------------------------------------- |
| module.exports = function() { | |
| var faker = require("faker"), | |
| _ = require("lodash"); | |
| return { | |
| people: _.times(100, function (n) { | |
| return { | |
| id: n, | |
| name: faker.name.findName(), | |
| jobTitle: faker.name.jobTitle() | |
| } |
| function isPalindrome( string ) { | |
| var notWordPattern = /\W/g, | |
| alphaNumericOnly = string | |
| .replace( notWordPattern, "" ) | |
| .toLowerCase(), | |
| alphaNumericOnlyReversed = alphaNumericOnly.reverse() | |
| return alphaNumericOnly == alphaNumericOnlyReversed | |
| } |
| WindowResizeManager = function( debounceWait ) { | |
| this.debounceWait = debounceWait || 200; | |
| _.bindAll(this, "handleWindowResizeEvent", "triggerWindowResizeCompleteEvent"); | |
| this.cacheDom(); | |
| this.bindWindowResizeEvent(); | |
| }; | |
| WindowResizeManager.prototype.cacheDom = function() { | |
| this.window: $(window); | |
| }; |
| function calculateMedian( array ) { | |
| var arraySize = array.length | |
| if ( arraySize === 1 ) { | |
| return array[0] | |
| } | |
| var isOddLength = isOdd( arraySize ), | |
| middleIndex = Math.floor( arraySize / 2.0 ) | |
| array.sort( subtract ) |
| { | |
| "presets": ["es2015", "react"] | |
| } |
| #!/usr/bin/env bash | |
| mkdir Tools | |
| cd Tools | |
| ln -s /Applications/Utilities/Activity\ Monitor.app Activity\ Monitor | |
| ln -s /Applications/Android\ Studio.app Android\ Studio | |
| ln -s /Applications/Atom.app Atom | |
| ln -s /Applications/Automator.app Automator | |
| ln -s /Applications/CocoaRestClient.app CocoaRestClient |
| { | |
| "presets": ["react"], | |
| "plugins": ["transform-es2015-modules-commonjs"] | |
| } |
| class TextInputControl extends _react2.default.Component { | |
| constructor(props) { | |
| super(props); | |
| this.bindInstanceMethods('handleBlurEvent', 'handleChangeEvent'); | |
| this.handleChangeEventDebounced = (0, _debounce2.default)(this.handleChangeEvent, props.inputChangeDebounceWait); | |
| } | |
| bindInstanceMethods(...methods) { | |
| methods.forEach(method => this[method] = this[method].bind(this)); |