Skip to content

Instantly share code, notes, and snippets.

const initialState = {
//
}
const reducer = (state, action) => {
switch (action.type) {
default:
return state
}
}
{
"import Link from components/common/Link": {
"prefix": "gcl",
"body": "import Link from 'components/common/Link'"
},
"border test": {
"prefix": "b1",
"body": "border: '1px solid red',"
},
"border test2": {
POST https://test.someapi.com/v1/account/user/login/
Content-Type: application/json
{ "email": "[email protected]", "password": 1 }
function createAccount(
username = '',
password = '',
nickname = '',
email = '',
gender = 'Male',
bio = '',
subscription = 'Basic',
callback,
) {
function createAccount({
username = '',
password = '',
nickname = '',
email = '',
gender = 'Male',
bio = '',
subscription = 'Basic',
callback,
}) {
function createAccount({
password = '',
nickname = '',
email = '',
gender = 'Male',
bio = '',
subscription = 'Basic',
callback,
}) {
if (!password || !email) {
createAccount({
password: 'applebee123x123',
email: '[email protected]',
bio: 'My bio',
callback: function cb(err, data) {
if (err) {
console.error(err)
}
// do something with data
},
getPhoto('../nemo_the_fish.jpg')
.applyFilter('grayscale', '100%')
.rotate(100)
.scale(1.5)
const createWarrior = function createWarrior(name) {
let hp = 100
let battleCryInterval = 0
return {
bash: function(target) {
target.reduceHp((target.getHp() - 10))
return this
},
// Increase the wrarior's health by 60, decrementing it by 1 every second for 60 seconds
$(window).resize(function() {
$('#logbox').append('<div>The window resized</div>')
})