This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const batchOfWhatUWant = (items, batchLength = 5000) => { | |
const allItems = items | |
const batchCount = allItems.length / batchLength | |
return Array(Math.ceil(batchCount)) | |
.fill(0) | |
.map((element, index) => index * batchLength) | |
.map(start => allItems.slice(start, start + batchLength)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const acc=[] | |
tableRoot = document.querySelector('table.properties-table') | |
.querySelectorAll('tbody>tr.ng-scope:not(.ng-hide)>td>input[type="text"]') | |
.forEach(( current,index) => { | |
if (index % 2 === 0) { | |
acc.push({}) | |
acc[acc.length - 1].name = current.value | |
} else { | |
acc[acc.length - 1].value = current.value | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.directive('myDirective', [function () { | |
return { | |
restrict : 'E', | |
replace : true, | |
controller: 'MyController', | |
templateUrl : 'directives/myDirective.tpl.html', | |
link : function (scope, elem, attrs, controller) { | |
scope.message = 'Hello World!'; | |
controller.toto(); | |
} |