Skip to content

Instantly share code, notes, and snippets.

View mannuelf's full-sized avatar
👾

Mannuel Ferreira mannuelf

👾
View GitHub Profile
@mannuelf
mannuelf / cmdLineToolsAndroidDev
Last active August 29, 2015 14:02
Run Android Emulator on MAC OS
Assuming you have JAVA and the SDK installed and...
you are wanting to test stuff using Android Emulator on MAC here are a few key commands and steps to get it going.
List Android Virtual Devices
$ => android list
Create Android Virtual Device
$ => android create avd -n myDroid-4.4.2 -t android-19 --abi default/x86
@mannuelf
mannuelf / functions.js
Last active August 29, 2015 14:02
Define a Function
// function constructor : the last paramater is the function logic, everything before it is a paramater
var theConstructor = new Function('x', 'y', 'return x + y');
// function statement
function theStatement(x, y) {
return x + y
};
// function expression
var theExpression = function(x, y) {
@mannuelf
mannuelf / invokingFunction.js
Created June 15, 2014 17:41
Invoking a Function
// functions are invoked using four different scenarios or patterns
/*
1. As a function
2. As a method
3. As a constructor
*/
// function pattern
var myFunction = function(){
return 'foo';
@mannuelf
mannuelf / globalFunctionsHeadObject.js
Created June 15, 2014 21:13
Global Functions Contained Within the Head Object
// predefined JavaScript functions
decodeURI()
decodeURIComponent()
encodeURI()
encodeURIComponent()
eval()
isFinite()
isNan()
parseFloat()
@mannuelf
mannuelf / newObjLiteralNotion.js
Last active August 29, 2015 14:04
new Object literal notation
var manny = {
name: "Mannuel Ferreira",
age: 32
};
@mannuelf
mannuelf / newObjectContstructor.js
Created August 2, 2014 07:40
new Object constructor
var manny = new Object();
manny.name = "Mannuel Ferreira";
manny.age = 32;
manny.profession = "Web developer";
@mannuelf
mannuelf / addressbook.js
Created August 2, 2014 23:07
AddressBook Print list
var bob = {
firstName: "Bob",
lastName: "Jones",
phoneNumber: "(650) 777-7777",
email: "bob.jones@example.com"
};
var mary = {
firstName: "Mary",
lastName: "Johnson",
@mannuelf
mannuelf / forLoopPrintOut.js
Created August 3, 2014 00:42
for loop print out properties of an object
var nyc = {
fullName: "New York City",
mayor: "Bill de Blasio",
population: 8000000,
boroughs: 5
};
for ( var property in nyc ) {
console.log(property);
}
@mannuelf
mannuelf / hasOwnProperty.js
Created August 3, 2014 00:44
hasOwnPoperty
var suitcase = {
shirt: "Hawaiian"
};
if(suitcase.hasOwnProperty("shorts")){
console.log(suitcase.shorts);
}
else {
suitcase.shorts = "Denim";
console.log(suitcase.shorts);
@mannuelf
mannuelf / listAllProperties.js
Created August 3, 2014 00:49
List ALL the Properties!
var nyc = {
fullName: "New York City",
mayor: "Bill de Blasio",
population: 8000000,
boroughs: 5
};
// write a for-in loop to print the value of nyc's properties
for(var x in nyc) {
console.log(nyc[x]);