Skip to content

Instantly share code, notes, and snippets.

View pertrai1's full-sized avatar
🏠
Working from home

Rob Simpson pertrai1

🏠
Working from home
View GitHub Profile
@pertrai1
pertrai1 / new_gist_file
Created September 15, 2013 04:21
node-express-mongo/
// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser('your secret here'));
app.use(express.session());
@pertrai1
pertrai1 / new_gist_file
Created September 24, 2013 11:36
Git Log Pretty
git log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
@pertrai1
pertrai1 / new_gist_file.js
Created October 23, 2013 09:21
Justified Vertical Centered Nav Bar
$('.nav-main').each(function () {
var nav = $(this);
// Give the containing element a class name to let the CSS know it is active
nav.addClass('active');
nav.find('li').each(function () {
var item = $(this);
var link = item.find('a');
var href = link.attr('href');
// When an li element is clicked, open the href of the link it contains
item.click(function (e) {

Launch the instance and connect with ssh.

##Update the server

sudo yum update

##Install php and MySQL packages

{
"path": "/usr/local/share/npm/bin:/usr/local/bin:$PATH",
"working_dir": "${project_path:${folder}}",
"cmd": ["karma", "start"]
}
@pertrai1
pertrai1 / angularDirectives
Created March 11, 2014 12:08
Angular Directive Options
angular.module('appName', [])
.directive('myDirective', function() {
return {
restrict: Strung,
priority: Number,
terminal: Boolean,
template: String or Template Function:
function(tElement, tAttrs) {
}
@pertrai1
pertrai1 / index.html
Created April 24, 2014 08:47
A Pen by Rob simpson.
<div class="experience">
<p>This is the paragraph</p>
</div>
@pertrai1
pertrai1 / Angular Bootstrap
Created April 24, 2014 09:41
Angular Bootstrap
window.onload = function() {
var $rootElement = angular.element(window.document);
var modules = [
'ng',
'myApp',
function($provide) {
$provide.value('$rootElement', $rootElement)
}
];
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />
<title>
Aborting AJAX Requests Using $http And AngularJS
</title>
<style type="text/css">
@pertrai1
pertrai1 / config
Last active August 29, 2015 14:03
RequireJS Config
/*jslint node: true, nomen: true, unparam: true */
/*global jquery, _, $ */
'use strict';
require.config({
// 3rd party script alias names (Easier to type "jquery" than "libs/jquery, etc")
// probably a good idea to keep version numbers in the file names for updates checking
paths: {
// Core Libraries