-
Open the Terminal
-
Use
mysqldump
to backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql
-
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
/* | |
// sample data format (contains info. of nodes of git branches). | |
var sampleData = [{ | |
branchName : 'feature/feat1/temp-develop1', | |
status : 'tracked' | |
}, | |
{ | |
branchName : 'tempo-branch', | |
status : 'false' | |
}, |
Example code for exporting data in a table to a csv file. |
#MongoDB - Basic Commands
##Saving Data
db //Tells you the current database
show collections //Shows the collections available in the current db
db.foo.save({_id:1, x:10}) //Save the document into the foo collection
db.bar.save({_id:1, x:10}) //Save the document into the bar collection
This is the easiest way you can: | |
var thisDate = ISODate("2016-01-07T00:00:00Z"); | |
Model.find({ | |
startDate: { | |
'$lte': thisDate | |
}, | |
endDate: { | |
'$gte': thisDate |
<?php | |
/* | |
// save this file to: ExcelService.class.php | |
Create new folder 'libs' under your project dir, and download PHPExcel-1.8 library .zip from here.. | |
use this clone url: git@github.com:PHPOffice/PHPExcel.git | |
OR https://github.com/PHPOffice/PHPExcel. | |
*/ | |
define('TMP_FILES', "../temp/"); // temp folder where it stores the files into. |
Let's have a look at this html in the dom: | |
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12"> | |
<a href="https://facebook.com/" target="_blank"> | |
<div class="app-logo" style="width: 716px; height: 60px; background: none;"></div> | |
</a> | |
</div> | |
jquery code: |
/* A very simple and nice function to swap DOM elements */ | |
// Solution #1 | |
function swap($elementA, $elementB) { | |
var temp = $('<div>').insertAfter($elementA); | |
$elementA.insertAfter($elementB); | |
$elementB.insertBefore(temp); | |
temp.remove(); | |
} |
function retry(isDone, next) { | |
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false; | |
var id = window.setInterval( | |
function() { | |
if (isDone()) { | |
window.clearInterval(id); | |
next(is_timeout); | |
} | |
if (current_trial++ > max_retry) { | |
window.clearInterval(id); |