log
Inserts console.log(")
console.log('Class: $CLASS$, Function: $FUNCTION$, Line $LINE$ $PARAM_TEXT$($EXPECTED$): ',
$PARAM$);$END$
public class PECS { | |
public static void main(String[] args) { | |
// PECS (Producer Extends Consumer Super) | |
// Consumer | |
List<? super Number> consumerNumbers = new ArrayList<>(); | |
consumerNumbers.add(Byte.valueOf((byte) 1)); | |
consumerNumbers.add(Short.valueOf((short) 1)); | |
consumerNumbers.add(Integer.valueOf((int) 1)); | |
consumerNumbers.add(Long.valueOf((long) 1)); |
curl -fsSL get get.docker.com -o get-docker.sh | |
sh get-docker.sh | |
docker -v | |
sudo usermod -aG docker $USER |
{ | |
"presets": ["es2015"], | |
"plugins": [ | |
"syntax-async-functions", | |
"transform-regenerator", | |
[ | |
"transform-runtime", | |
{ | |
"polyfill": false, | |
"regenerator": true |
function createReduce(reducer = {}, initialState) { | |
return (state = initialState, action) => { | |
const { type: actionType } = action; | |
const func = reducer[actionType]; | |
const newState = typeof func === 'function' ? func.call(reducer, state, action) : undefined; | |
return newState !== undefined ? newState : state; | |
}; | |
} | |
// example |
import React from 'react'; | |
import { Router } from 'react-router-dom'; | |
import { createBrowserHistory } from 'history'; | |
function FixedRouter({ history = createBrowserHistory(), children }) { | |
const originalPush = history.push; | |
// monkey patching | |
history.push = (url, ...args) => | |
originalPush( | |
url.replace(/%/g, percent => encodeURI(encodeURI(percent))), |
{ | |
"config": { | |
"imports": { | |
"first-react-portlet": { | |
"react": "15.6.2", | |
"react-dom": "15.6.2" | |
} | |
} | |
} | |
} |
{ | |
"presets": [ | |
"@babel/preset-env", | |
"@babel/preset-react" | |
], | |
"plugins": [ | |
"@babel/plugin-transform-destructuring" | |
] | |
} |
import React, { memo } from 'react'; | |
import * as linkifyjs from 'linkifyjs'; | |
function splitTextAndLinks(value = '') { | |
const links = linkifyjs.find(value); | |
const values = []; | |
let index = 0; | |
for (const { value: link, href } of links) { | |
const urlBeginIndex = value.indexOf(link, index); | |
const text = value.substring(index, urlBeginIndex); |
public class BuilderExample { | |
public static void main(String[] args) { | |
User user = new UserBuilder().id(1).name("One").build(); | |
} | |
} | |
class Entity { | |
protected int id; | |
public Entity(int id) { |