Skip to content

Instantly share code, notes, and snippets.

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

Jason Jacob jayco

🏠
Working from home
View GitHub Profile
@jayco
jayco / new server module
Created October 28, 2012 09:58
assign new server module in node js
// Hello world example in nodejs
//writen by jayco
// Create server variable and assign it the node http module
var http_server = require('http');
@jayco
jayco / create server function
Created October 28, 2012 10:01
create new server instance
/* Create the new server:
Create server and pass it an anonymous function as the argument.
The reason for this is that the function will be
called whenever there is a new request to the webserver. The function is
directly attached to the new webservers (http_server) event listener for
the request event that is passed.
*/
http_server.createServer(
@jayco
jayco / consolelog
Created October 28, 2012 10:18
log to console
/* log to the console:
This allows us to log the output to the console for development purposes,
no different to how it is done in browser oriented javascript
*/
console.log('server running at http://127.0.0.1:8124/');
@jayco
jayco / node install dev pre
Created October 28, 2012 10:30
dev packages
#install dev packages
sudo apt-get install g++ curl libssl-dev apache2-utils
#if you haven't already installed git
sudo apt-get install git-core
@jayco
jayco / node install download node
Created October 28, 2012 10:38
download node
#enter in repo
git clone git://github.com/joyent/node.git
#navigate into folder
cd node
#run the configure executable
./configure
#run the make file
@jayco
jayco / nvm
Created October 28, 2012 10:57
nvm
#clone the nvm from here
git clone git://github.com/creationix/nvm.git ~/nvm
#then source it and add it to you bash shell in $HOME/.bashrc:
. ~/nvm/nvm.sh
#then install
nvm install 0.6.16
#make sure you specify to use it
@jayco
jayco / nvm
Created October 28, 2012 11:01
nvm sourcemint
#Install sourcemint
npm install -g sm
#Install cloud9 in the /opt directory
cd /opt
#Then clone the cloud9 git repo
git clone https://github.com/ajaxorg/cloud9.git cloud9
#navigate to downloaded directory
@jayco
jayco / nvm
Created October 28, 2012 11:05
load cloud9
#navigate to directory
cd /opt/cloud9
#to run cloud9
bin/cloud9.sh
#or to point it to a directory and run it
bin/cloud9.sh -w ~/workspace/node_project
@jayco
jayco / pipeline.yml
Last active November 5, 2019 08:15
Repo hooks
steps:
- label: get meta data
env:
REPO_NAME: ""
commands:
- 'echo $$REPO_NAME'
steps:
- command: "true"
concurrency_group: "gate"
concurrency: 1
key: "gate"
- wait
- label: "build"
command: >