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
#!/usr/bin/env ./node_modules/coffee-script/bin/coffee | |
sys = require 'sys' | |
express = require 'express' | |
assets = require 'connect-assets' | |
proxy = require 'http-proxy' | |
server = proxy.createServer (req, res, proxy) -> | |
if req.url.match /^\/?api/ | |
backend = |
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
// If you don't use underscore.js, use it (http://documentcloud.github.com/underscore/) | |
// Then, use underscore's mixin method to extend it with all your other utility methods | |
// like so: | |
_.mixin({ | |
escapeHtml: function () { | |
return this.replace(/&/g,'&') | |
.replace(/>/g,'>') | |
.replace(/</g,'<') | |
.replace(/"/g,'"') | |
.replace(/'/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
{ | |
"name": "Meteor", | |
"version": "0.3.2", | |
"description": "A new way to build apps.", | |
"author": "Meteor Development Group", | |
"homepage": "http://www.meteor.com/", | |
"repository": { | |
"url": "https://github.com/meteor/meteor" | |
}, | |
"dependencies": { |
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'); |
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
/* 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
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
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
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
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` |