[React Native ] - All of things
May 29, 2020 |React Native
OR npm
$ npm install --save react-native-fbsdk-next
hw.gpu.mode=software (or hardware)
Step 4: Download the google-services.json, put it in ./android/app
Home
»
All posts
document.getElementById("<id>").innerHTML = "Hello JavaScript";
document.getElementById("<id>").style.<attribute> = "<value>";Function:
function myFunction() { // return with object return object; } function myFunction() { // void function } function function1 (parameter1, parameter2, parameter3) { // code to be executed }Document:
document.write(<value>);
// we console useful for debug a script. console.log(message); //alert show message to user but sometime we can use debug script.alert(message);
var person = { firstName: "John", lastName : "Doe", id : 5566, fullName : function() { return this.firstName + " " + this.lastName; } }; //access object person.firstName or person["firstName"];String method:
var str = "acb def abc"; str.length; // length no of String, value = 7 // returns the index of (the position of) the first occurrence of a specified textstr.indexOf("def"); //value = 4 //returns the index of the last occurrence of a specified textstr.lastIndexOf("abc"); // value = 8 // method searches a string for a specified value and returns the position of the match str.search("def"); // value = 4 //extracts a part of a string and returns the extracted part in a new string. str.slice(start_index, end_index);str.slice(7, 9); //value = abstr.slice(-9, -7); //value = ef // extracts a part of a string and returns the extracted part in a new (NOT ACCEPTED negetive index)str.substring(start_index, end_index);Ex: str.substring(7, 9); //value = ab // same slice but different second parameter is lengh of substring.str.substr(start, length); Ex: str.substr(7, 2); //value = ab str.replace(old string, new string); // Replace first search string str.replaceAll(old string, new string); // Replacea all search string
str.toUpperCase();
str.toLowerCase();
str.concat("string1","string2");
isNaN(x); // check is number or not. //returns a string, with the number written with a specified number of decimals var x = 1.876; x.toFixed(0); // returns 2 x.toFixed(2); // returns 1.88 //returns a string, with a number written with a specified length. x.toPrecision(); // returns 1.876 x.toPrecision(2); // returns 1.88 x.toPrecision(4); // returns 1.876 x.toPrecision(6); // returns 1.87600 Number() // Returns a number, converted from its argument. parseFloat() // Parses its argument and returns a floating point number parseInt() // Parses its argument and returns an integerCollection (Array, Map):
var array= ["a", "b", 10]; var temp; //accessarray[index]; //add element to arrayarray.push("Lemon"); for (i = 0; i < length of array; i++) { } //for each 1 array.forEach(myFunction); function myFunction(value) {...} //for each 2 array.forEach({ $(this) // element }); //push() var temp = ["a", "b"]; array.push(temp);
<div id="tabDiv">
<ul>
<li><a href="#suspensionTab"><sm:msg code="Suspension_Activation_Replacement"/></a></li>
<li><a href="#terminationTab"><sm:msg code='Termination_Record_Master'/></a></li>
</ul>
<div id="suspensionTab">
<div id="terminationTab">
</div>
$('#tabDiv').click('tabsselect', function (event, ui) {
var activeTab = $('#tabDiv').tabs('option', 'active');
});class Form{
set foo(val){
console.log("setting foo")
this.fooValue = val;
}
get foo(){
console.log("getting foo");
return this.fooValue;
}
}
let frm = new Form();
frm.foo = "bar";
console.log(frm.foo);var form = {
a: "aValue",
b: "bValue"
}
function withGetterSetter(obj){
var keys = Object.keys(obj);
var result = {};
for(var i=0;i<keys.length;i++){
var key = keys[i];
result[key+"_internal"] = obj[key];
(function(k){
Object.defineProperty(result,k, {
get:function() {
console.log("getting property:",k);
return this[k + "_internal"];
},
set: function(x) {
console.log("setting property:",k);
this[k + "_internal"] = x
}
});
})(key)
}
return result;
}
var setterObj = withGetterSetter(form);
console.log(setterObj.a);
setterObj.a = "updated";
console.log(setterObj.a);const adventurer = {
name: 'Alice',
cat: {
name: 'Dinah',
},
};
const dogName = adventurer.dog?.name;
console.log(dogName);
// Expected output: undefined
console.log(adventurer.someNonExistentMethod?.());
// Expected output: undefinedvar date = new Date();
var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.includes("Mango"); // return true if existed$.ajax({
url: <url>,
type: <GET, POST, PUT,...>,
async: <true, false>,
dataType: <text, json,xml,...>,
data: { //paramter for sending....
},
success:function(data, status, xhr) {
//get data here
}
});
Ex:
var test = ajax(); // test maybe doesn't have value because of async = true,
funtion ajax(){
.....
async: true,
.....
success:function(data, status, xhr) {
return data;
}
}
var test = ajax(); //test will be have data.
funtion ajax(){
var result;
var response = $.ajax({
url: <url>,
type: <GET, POST, PUT,...>,
async: false,
dataType: <text, json,xml,...>,
data: { //paramter for sending....
},
success:function(data, status, xhr) {
//get data here
result = data;
}
});
if (result) {
return result;
}
}
=========================================================================
I) How to remove something from right click context menu windows 10
Sometime, Context menu in right click has many items and long line. we should remove some item that you not use long time or frequently.
1. Go to Run or Window + R
2. Type 'regedit'
3. Go to Computer\HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers
4. Choose programs which you want to disable menu.
5. Change default value to -{hex code}.
Ex:
Before: {A94757A0-0226-426F-B4F1-4DF381C630D3}
After: -{A94757A0-0226-426F-B4F1-4DF381C630D3}
Video ref:
2. Folder/File not refresh
Ref: https://superuser.com/questions/390030/explorer-does-not-auto-refresh
Refer to Windows 7 does not refresh folder views on Microsoft Answers and Windows Explorer doesn't refresh when moving/deleting. Several posters stated that the issue pertains to the Windows UI Shell and several solutions exist:
Let me know if these links help you out!
Share With YouSoftware Engineer Email: hoquoctri@live.com Skype: hoquoctri.it.tdt |