Skip to content

Instantly share code, notes, and snippets.

View pmanijak's full-sized avatar
📷

Philip Manijak pmanijak

📷
  • Olympia, Washington
View GitHub Profile
@pmanijak
pmanijak / Run Circle-Blvd on EC2
Last active August 29, 2015 14:00
Circle Blvd server setup on Ubuntu 14 on Amazon: http://circleblvd.org
These are instructions for setting up Circle Blvd on an Amazon EC2 instance running Ubuntu,
or really any Ubuntu server you are happy with.
It assumes the default user account is 'ubuntu' (created by the AMI).
Directions:
0. Create an EC2 instance using Amazon Web Services
--> AMI: Ubuntu Server 14 (free tier)
--> Security group: Add HTTP, HTTPS, and SSH rules
@pmanijak
pmanijak / .Deploy Circle Blvd with git push
Last active August 29, 2015 14:00
Circle Blvd: Deploy with git, precariously: http://circleblvd.org
1. Prerequisites (see below)
2. Set up the server
3. Set up the client
@pmanijak
pmanijak / design-doc.js
Last active August 29, 2015 14:04
Example CouchDB design document with map-reduce
// Most of the times an aggregation function is needed,
// it is a simple count or sum, which are supported by
// built-in functions of both CouchDB and MongoDB.
//
// This is a CouchDB design document:
var circlesDesignDoc = {
url: '_design/circles',
body: {
version: "1.0.1",
@pmanijak
pmanijak / instructions.txt
Last active August 29, 2015 14:04
Adding app-pool permissions to a folder in IIS
To add the proper permissions to a Node.js folder in IIS, give the following object write access:
IIS AppPool\<app identity>
@pmanijak
pmanijak / guide.txt
Last active August 29, 2015 14:06
Circle Blvd: Migration Guide
How to move Circle Blvd to a new server, a rough guide:
1. Setup CouchDB and Node
2. Use ssh to replicate. Something like this:
$ curl -X POST http://localhost:5984/_replicate -H 'Content-Type: application/json' -d '{"source":"http://localhost:9000/circle-blvd","target":"http://localhost:9001/circle-blvd","create_target":true}'
$ curl -X POST http://localhost:5984/_replicate -H 'Content-Type: application/json' -d '{"source":"http://localhost:9000/circle-blvd-sessions","target":"http://localhost:9001/circle-blvd-sessions","create_target":true}'
3. Copy the SSL certificates
@pmanijak
pmanijak / view.js
Last active August 29, 2015 14:23
View for Circle Blvd evaluation application
function(doc) {
if (doc.type
&& doc.type === "archive"
&& doc.summary
&& doc.summary.indexOf("Apply to evaluate Circle Blvd") >= 0) {
emit(doc.timestamp, doc);
}
}
@pmanijak
pmanijak / header-footer.js
Created August 20, 2012 00:53
Header-footer includes plus active navbar with jQuery
@pmanijak
pmanijak / angular-invalid.js
Created August 28, 2012 07:22
Validation on blur with AngularJS
// Make a custom "invalid" class that goes away
// when an element is focused.
var setupValidation = function(selector) {
$(selector).blur(function() {
var elm = $(this);
if (isInvalid(elm)) {
elm.addClass("invalid");
}
});
@pmanijak
pmanijak / index.html
Created September 2, 2012 05:58
Service and template example with AngularJS for sharing data between controllers
<!doctype html>
<html ng-app="project">
<head>
<title>Angular: Service and template example</title>
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<script src="script.js"></script>
</head>
<body>
<div ng-view></div>
</body>
@pmanijak
pmanijak / gist:4172623
Created November 29, 2012 23:25
Installing mod_mono on OS X
This is one way to get mod_mono up with OS X (Lion), for experienced computer users,
but inexperienced Apache users. Note, this is just if you're trying to get one project
up and running quickly:
1. Apache is already installed. Don't worry about it.
2. Get mono for OS X: http://www.go-mono.com/mono-downloads/ (the SDK)
3. Get the latest source for mono_mod: http://download.mono-project.com/sources/mod_mono/
Extract the tar ball, go into the folder, and do this:
$ ./configure prefix=/Library/Frameworks/Mono.framework/Versions/2.10.9 --with-apxs=/usr/sbin/apxs --with-apr-config=/usr/bin/apr-1-config