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
git init | |
git add . | |
git commit -m 'First commit' | |
git remote add origin remote repository URL | |
git remote -v | |
git pull origin master | |
git push origin master |
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
// Mongo configuration file | |
/etc/mongod.conf | |
// Start Mongo service | |
sudo service mongod start | |
// Check if Mongo is running, last line should be: "[initandlisten] waiting for connections on port 27017" | |
cat /var/log/mongodb/mongod.log | |
// Check if Mongo is running |
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
/* --------------------- Variables --------------------- */ | |
/* SCSS */ | |
$primary-color: #333; | |
body { | |
color: $primary-color; | |
} |
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
// --------------------------- create basic server --------------------------- \\ | |
var http = require("http"); | |
var myServer = http.createServer(function (request, response) { | |
response.writeHead(200, {"Content-type": "text/html"}); | |
response.write("<p><strong> hello </strong> batkan </p>"); | |
response.end(); | |
}); | |
myServer.listen(3000); |
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
// app.js ---------------------------------------------------- | |
'use strict'; | |
angular | |
.module('app', [ | |
'ngSanitize', | |
'ngAnimate', | |
'ngTouch', | |
'ui.bootstrap', |
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
// --------------------------- create a model --------------------------- | |
yo meanjs:express-model <model-name> | |
// e.g | |
yo meanjs:express-model category | |
// --------------------------- create a controller --------------------------- | |
yo meanjs:express-controller <controller-name> | |
// e.g |
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
DB_HOST=127.0.0.1 | |
DB_PORT=3306 | |
DB_DATABASE=ghostblog | |
DB_USERNAME=admin | |
DB_PASSWORD=pass |
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
// some controller | |
$rootScope.isListing = false; | |
var page = '/listings'; | |
$rootScope.$on('$routeChangeSuccess', function (e, current, pre) { | |
var currentRoute = $location.path(); | |
(currentRoute == noFooterPage) ? $rootScope.isListing = true : $rootScope.isListing = false; | |
}); |
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
// WARNING: Use with caution. Don't use when displaying user-created content. | |
app.filter('html', ['$sce', function ($sce) { | |
return function(t) { | |
return $sce.trustAsHtml(t) | |
} | |
}]); | |
// Usage | |
<span ng-bind-html="yourDataValue | html"></span> |
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
// create user shota with password 1111, when logged in certain DB | |
CREATE USER shota WITH SUPERUSER LOGIN PASSWORD '1111'; | |
// grant all privileges to specific user | |
grant all privileges on database db_name to someuser; |
OlderNewer