Skip to content

Instantly share code, notes, and snippets.

View h3nr1ke's full-sized avatar
🤔
Should I?

H3NR1KE h3nr1ke

🤔
Should I?
View GitHub Profile
@h3nr1ke
h3nr1ke / const_003.js
Created December 20, 2018 17:09
const example ECMA 6
/**
* 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";
@h3nr1ke
h3nr1ke / const_002.js
Last active December 20, 2018 17:05
const example ECMA 6
/**
*
*/
const OBJ = {
prop1 : "foo",
prop2 : "bar",
prop3 : 100
}
console.log(OBJ);
@h3nr1ke
h3nr1ke / const_001.js
Created December 18, 2018 13:36
const example ECMA6
/**
*
*/
const DELAY = 1000; // a constant MUST be initialized
setTimeout(function(){
console.log("After 1 second…");
}, DELAY);
DELAY = 2000; // error
//END
@h3nr1ke
h3nr1ke / let_001.js
Created December 18, 2018 13:27
let example ECMA6
/**
*
*/
var _myVar = "Banana";
var _myFunction = function(){
_myVar = "Apple"
let _mySecondVar = "Avocado"
console.log("_myVar -> " + _myVar); 
console.log("_mySecondVar -> " + _mySecondVar); 
};
@h3nr1ke
h3nr1ke / var_002.js
Last active December 24, 2018 12:37
var example ECMA6
/**
*
*/
_myVar = "Banana"; // using a var before its is declared
console.log(_myVar);
var _myFunction = function(){
 _myVar = "Apple"; // using before the declaration
 console.log("_myVar -> " + _myVar); 
};
_myFunction(); // calling the variable before the declaration
@h3nr1ke
h3nr1ke / var_001.js
Last active December 18, 2018 13:21
ECMA6 var example 0001
/**
*
*/
var _myVar = "Banana";
console.log(_myVar);
var _myFunction = function(){
 _myVar = "Apple";
 console.log("_myVar -> " + _myVar); 
};
_myFunction();
@h3nr1ke
h3nr1ke / ECDSA_HOST_KEY_ERROR
Created October 22, 2018 14:56
ERROR ECDSA host key for <IP> has changed and you have requested strict checking. Host key verification failed. devestapar@markVI:~/Documents/DEV/chav
# 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
@h3nr1ke
h3nr1ke / flush_cache
Created July 19, 2018 21:14
Flush DNS cache mac os
# if you change the /etc/hosts and nothing happend... try flush the DNS cache
# OSX 10.9 +
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
@h3nr1ke
h3nr1ke / spotlight.sh
Created July 12, 2018 20:45
turn on or off mac os Spotlight indexing
# --- turn off
sudo mdutil -a -i off
# --- turn on
sudo mdutil -a -i on
@h3nr1ke
h3nr1ke / add_swap_ubuntu.sh
Created July 7, 2018 01:07
Add a swap memory partition to your ubuntu 16.04 server
#!/bin/bash
#-- create the swap
sudo fallocate -l 1G /swapfile
#-- change permission
sudo chmod 600 /swapfile
#-- do the swap
sudo mkswap /swapfile