#Mysql: Backup and Restore
Mysql Backup and restore through command line.
mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql
mysqldump -u root -p --all-databases > alldb.sql
// Map Object Type | |
const objMap: Record<string, string> = { | |
alu: 'mula', | |
}; |
console.log(add(5, 7)) // 12 | |
console.log(add(5)(7)) // 12 | |
console.log(add(3)(7)) // 10 | |
function greet(greeting, punctuation) { | |
return greeting + ' ' + this.user + punctuation; | |
} |
jest.mock('./embed-code/embed-code', () => { | |
return { | |
__esModule: true, | |
default: () => { | |
return <div>Embed component goes here</div>; | |
}, | |
}; | |
}); |
let mainArray = [{ value: '/AG_TURF-123', label: 'Ag & Turf', checked: false, id: 123, children: [{ value: '/AG_TURF-123/TRACTOR-456', label: 'Tractors', checked: false, id: 456, children: [{ value: '/AG_TURF-123/TRACTOR-456/Large-7-8-9-series', label: 'Large (7, 8, 9) Series', checked: false, id: 789, children: [{ value: '/AG_TURF-123/TRACTOR-456/Large-7-8-9-series/7-family-tractor', label: '7 Family Tractor', checked: false, id: 101112 }, { value: '/AG_TURF-123/TRACTOR-456/Large-7-8-9-series/8-family-tractor', label: '8 Family Tractor', checked: false, id: 131415 }, { value: '/AG_TURF-123/TRACTOR-456/Large-7-8-9-series/9-family-tractor', label: '9 Family Tractor', checked: false, id: 161718 }] }, { value: '/app/Http/routes.js', label: 'routes.js', checked: false, id: 181920 }] }, { value: '/app/Providers', label: 'Providers', checked: false, id: 212223, children: [{ value: '/app/Http/Providers/EventServiceProvider.js', label: 'EventServiceProvider.js', checked: false, id: 242526 }] }] }, { value: '/config', |
import { mount } from 'enzyme'; | |
import React from 'react'; | |
import InputField from './index'; | |
function setup() { | |
const props = { | |
label: 'FieldLabel', | |
name: 'fieldName', | |
onChange: jest.fn(), | |
value: 'fieldValue' |
<?php | |
add_filter( 'rest_api_init', 'rest_only_for_authorized_users', 99 ); | |
function rest_only_for_authorized_users($wp_rest_server){ | |
if ( !is_user_logged_in() ) { | |
wp_die('sorry you are not allowed to access this data','cheatin eh?',403); | |
} | |
} |
Git Squash | |
========== | |
# Reset the commit | |
git reset --soft HEAD~3 | |
# Add new message for the new commit | |
git commit -m "New message for the combined commit" | |
# Change Commit Author in X Amount of commits |
.selector { | |
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E"); | |
} | |
Data URL convert online tool | |
https://yoksel.github.io/url-encoder/ |
// ## Globals | |
var argv = require('minimist')(process.argv.slice(2)); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var browserSync = require('browser-sync').create(); | |
var changed = require('gulp-changed'); | |
var concat = require('gulp-concat'); | |
var flatten = require('gulp-flatten'); | |
var gulp = require('gulp'); | |
var gulpif = require('gulp-if'); | |
var imagemin = require('gulp-imagemin'); |