This file contains 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
# --- turn off | |
sudo mdutil -a -i off | |
# --- turn on | |
sudo mdutil -a -i on |
This file contains 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
# if you change the /etc/hosts and nothing happend... try flush the DNS cache | |
# OSX 10.9 + | |
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder | |
This file contains 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
# if you dont have the tool | |
# apt-get install mysql-client | |
mysql -u [USER] -p[PASS] -h [REMOTE_HOST] [DATABASE_NAME] | |
# after this commmand, the prompt will be | |
# mysql> | |
# and will accept SQL commands | |
# mysql> Select * from yourtable; |
This file contains 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
# sometimes its possible to get this error when your are trying to connect to a remote server using ssh | |
#if the message appear | |
ERROR ECDSA host key for <IP> has changed and you have requested strict checking. | |
Host key verification failed. | |
# you can run | |
ssh-keygen -R <IP> | |
# Host<IP> found: line 19 |
This file contains 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
/** | |
* | |
*/ | |
var _myVar = "Banana"; | |
console.log(_myVar); | |
var _myFunction = function(){ | |
_myVar = "Apple"; | |
console.log("_myVar -> " + _myVar); | |
}; | |
_myFunction(); |
This file contains 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
/** | |
* | |
*/ | |
var _myVar = "Banana"; | |
var _myFunction = function(){ | |
_myVar = "Apple" | |
let _mySecondVar = "Avocado" | |
console.log("_myVar -> " + _myVar); | |
console.log("_mySecondVar -> " + _mySecondVar); | |
}; |
This file contains 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 DELAY = 1000; // a constant MUST be initialized | |
setTimeout(function(){ | |
console.log("After 1 second…"); | |
}, DELAY); | |
DELAY = 2000; // error | |
//END |
This file contains 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 OBJ = { | |
prop1 : "foo", | |
prop2 : "bar", | |
prop3 : 100 | |
} | |
console.log(OBJ); |
This file contains 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
/** | |
* Constant as an array | |
*/ | |
const OBJ = ["foo","bar"]; | |
console.log(OBJ); | |
// chaging the value of a constant "variable" =) | |
// no errors displayed | |
OBJ[0] = "another value"; | |
OBJ[1] = "example text"; |
This file contains 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 OBJ = { | |
prop1 : 1, | |
prop2 : 2, | |
propA : "A", | |
propB : "B", | |
}; | |
OBJ.prop1 = 3; |