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
var fs = require('fs'); | |
var path = require('path'); | |
var Module = require('module'); | |
var detective = require('detective'); | |
// node-visitor | |
function visit(request, parent) { | |
var fn; | |
try { |
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
1. apt-get install software-properties-common | |
2. add-apt-repository ppa:chris-lea/redis-server | |
3. apt-get update | |
4. apt-get install redis-server |
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
1. wget http://nginx.org/keys/nginx_signing.key | |
2. apt-key add nginx_signing.key | |
3. nano /etc/apt/sources.list | |
paste `deb http://nginx.org/packages/ubuntu/ raring nginx` | |
paste `deb-src http://nginx.org/packages/ubuntu/ raring nginx` | |
4. apt-get update | |
5. apt-get install nginx |
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
01. `apt-get install git` | |
02. `adduser git` | |
03. `visudo` add `git ALL=(ALL:ALL) NOPASSWD: ALL` to user privilege specification | |
04. `login git` | |
05. `ssh-keygen -t rsa` | |
06. `mkdir project` | |
07. `mkdir project.git` | |
08. `cd project.git` | |
09. `git init --bare` | |
10. `cd hooks` |
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
ls -la /etc/systemd/system/multi-user.target.wants/ |
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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Numerics; | |
namespace ConsoleApplication4 | |
{ | |
class Program | |
{ |
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
var application_root = __dirname, | |
express = require("express"), | |
path = require("path"), | |
mongoose = require('mongoose'); | |
var app = express.createServer(); | |
// database | |
mongoose.connect('mongodb://localhost/ecomm_database'); |
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
/* The API controller | |
Exports 3 methods: | |
* post - Creates a new thread | |
* list - Returns a list of threads | |
* show - Displays a thread and its posts | |
*/ | |
var Thread = require('../models/thread.js'); | |
var Post = require('../models/post.js'); |
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
[Auth] | |
public class ReportService : RestServiceBase<Report> | |
{ | |
public IReportRepository Repository { get; set; } | |
public override object OnGet(Report request) | |
{ | |
using (var producer = MessageFactory.CreateMessageProducer()) | |
{ | |
producer.Publish(request); |
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
var fs = require('fs'); | |
var path = require('path'); | |
function cssIncImages(cssFile) { | |
var imgRegex = /url\s?\(['"]?(.*?)(?=['"]?\))/gi; | |
var css = fs.readFileSync(cssFile, 'utf-8'); | |
while (match = imgRegex.exec(css)) { | |
var imgPath = path.join(path.dirname(cssFile), match[1]); | |
try { | |
var img = fs.readFileSync(imgPath, 'base64'); |