Connect to different MongoDB database depending on enviornment
# server.coffee
mongoose = require "mongoose"
app.configure "development", ->
mongoose.connect "localhost", "app-dev"
#!/usr/bin/env python3.2 | |
################################################################# | |
# Lim Jiew Meng (A0087884H) | |
# CS2106 OS Proj 2 : Page Replacement Algorithms | |
################################################################# | |
import argparse | |
import random | |
from math import floor |
#!/usr/bin/env python3.2 | |
################################################################## | |
# Lim Jiew Meng (A0087884H) | |
# CS2106 OS Project 2 : Page Replacement Algorithms | |
################################################################## | |
import argparse | |
from rsgen import ReferenceStringGenerator | |
from vm import VirtualMemory, RandomPageReplacement, FifoPageReplacement, LruPageReplacement |
/** | |
* @ORM\PrePersist | |
*/ | |
public function uploadIcon() { | |
// proceed with upload only if isDirty | |
if (!$this->isDirty) | |
return; | |
// delete the old file if any | |
$oldIcon = APP_ROOT .'/uploads/' . $this->iconUrl; |
pacman -Syyu | |
# for nvidia xf86-video-nouveau, virtualbox: virtualbox-archlinux-additions | |
pacman -S dbus xorg-server xorg-server-utils alsa-utils mesa xf86-video-ati sudo acpi pm-utils cpufrequtils vbetool xfce4 xfce4-power-manager | |
# start dbus manually | |
# /etc/rc.d/dbus | |
# start dbus automatically | |
# add to rc.conf > DAEMONS=(..., dbus) | |
# Virtual box guest: `modprobe -a vboxvideo vboxguest vboxsf vboxnetflt` or in /etc/rc.conf `MODULES=(... vboxvideo ...)` |
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Backbone Auth Test</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/coffee-script/1.3.1/coffee-script.min.js"></script> | |
<script type="text/coffeescript"> |
{spawn, exec} = require "child_process" | |
# process the output of a spawned process | |
# see **[link](http://stackoverflow.com/a/7376108/292291)** | |
processOutput = (proc) -> | |
proc.stdout.on "data", (data) -> | |
console.log data.toString().trim() | |
task "startdev", "Starts server with nodemon and watch files for changes", -> | |
# start nodemon server |
node_modules/ | |
public/css/app | |
public/js/app | |
lib-cov | |
*.seed | |
*.log | |
*.csv | |
*.dat | |
*.out |
define [ | |
"marked", | |
"jquery", | |
"mathjax" | |
], (marked, $, MathJax) -> | |
# see: http://cdn.mathjax.org/mathjax/latest/test/sample-dynamic-2.html | |
class MathJaxMarkdownEditor | |
inputName: "#editor" |