Skip to content

Instantly share code, notes, and snippets.

View mannuelf's full-sized avatar
👾

Mannuel Ferreira mannuelf

👾
View GitHub Profile
@mannuelf
mannuelf / inheritance.js
Created August 3, 2014 01:36
inheritance
// the original Animal class and sayName method
function Animal(name, numLegs) {
this.name = name;
this.numLegs = numLegs;
}
Animal.prototype.sayName = function() {
console.log("Hi my name is " + this.name);
};
// define a Penguin class
@mannuelf
mannuelf / privateVarPublicMethod.js
Last active August 29, 2015 14:04
Private Variables and Public Methods
function Person(first,last,age) {
this.firstname = first;
this.lastname = last;
this.age = age;
//private property
var bankBalance = 7500;
// set public method to make bankbalance available
this.getBalance = function() {
// your code should return the bankBalance
@mannuelf
mannuelf / xmlhttprequest.js
Created August 5, 2014 20:16
XMLHTTPRequest
var xhr = new XMLHttpRequest()
xhr.open("GET", "http://www.themwebs.me/", false);
xhr.send();
console.log(xhr.status);
console.log(xhr.statusText);
@mannuelf
mannuelf / reserved.names.js
Created August 7, 2014 03:45
JavaScript reserved names
abstract
boolean break byte
case catch char class const continue
else enum export extends
false final finally float for function
goto
if implements import in instanceof int interface
long
native new null
package private protected public
@mannuelf
mannuelf / tail.txt
Created August 19, 2014 06:38
tail
tail -f /var/log/tomcat6/catalina.out | grep
@mannuelf
mannuelf / Conditional-Classes.markdown
Created September 7, 2014 11:56
A Pen by Mannuel.
@mannuelf
mannuelf / directives-basics.html
Created September 10, 2014 04:28
Angular Directive
<html ng-app="my-app"> <!-- attach application module to page -->
<body ng-controller="StoreController as store"> <!-- attach controller function to page -->
<h1 ng-show="name">Hello, {{name}}</h1> <!-- display a section based on an Expression -->
<div ng-repeat="product in store.product"></div> <!-- repeat a section for each item in an Array -->
</body>
</html>
@mannuelf
mannuelf / set-root-password.sh
Last active August 29, 2015 14:08
SET A PASSWORD FOR THE MySQL root USER
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h mannuel-MacBookPro password 'new-password'
@mannuelf
mannuelf / alt-set-root-password.sh
Last active August 29, 2015 14:08
Alternate SET A PASSWORD FOR THE MySQL root USER
/usr/bin/mysql_secure_installation
@mannuelf
mannuelf / start-mysql-deamon.sh
Last active August 29, 2015 14:08
Start MySQL daemon
cd /usr ; /usr/bin/mysqld_safe &