Skip to content

Instantly share code, notes, and snippets.

View Bear-Foot's full-sized avatar

Wilfried Boukhers Bear-Foot

  • Freelance
  • France
View GitHub Profile
@Bear-Foot
Bear-Foot / gist:c3745d5219a3585f25cecab247cea7a7
Created January 24, 2022 09:12
Custom console.log shortcut vscode
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+r",
"command": "editor.action.insertSnippet",
"args": {
"snippet": "console.log('${CLIPBOARD}', ${CLIPBOARD})"
},
}
]
function arg1(arg){return arg === 1}
function arg2(arg){return arg !== 1}
function combineFilters(filters) {
return filters.reduce(function (prev, curr) {
return function (arg) {
return prev(arg) && curr(arg)
}
}, function (){return true})
@Bear-Foot
Bear-Foot / gist:bc48e0e91bbf921297c8
Last active August 29, 2015 14:24
WillReceiveProps
componentWillMount () {
this.foo(this.props)
},
componentWillReceiveProps (nextProps) {
this.foo(nextProps)
},
foo(props) {
//code
}
// UPD:
// Now available as npm module!
// Check out https://github.com/RReverser/better-log for details.
console.log = (function (log, inspect) {
return function () {
return log.apply(this, Array.prototype.map.call(arguments, function (arg) {
return inspect(arg, { depth: 1, colors: true });
}));
};