This file contains hidden or 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 results; | |
function doPoll(){ | |
$.getJSON('http://localhost:3000/period', function(data) { | |
results = data; | |
setTimeout(doPoll,5000); | |
}); | |
}; | |
doPoll(); |
This file contains hidden or 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
jdbc.open(); | |
jdbc.on('open', function(err, conn) { | |
if (conn) { | |
jdbc.on('executeQuery', query.queryHandler); | |
_.each(sql, function(queries) { | |
setInterval(function(){ | |
jdbc.executeQuery(queries.sql); | |
}, 1000); |
This file contains hidden or 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 proverbs = JSON.parse(fs.readFileSync(config.dictionary.proverbs)); | |
console.log(_.sample(proverbs)); |
This file contains hidden or 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
app.get('/keep/staff', function(req, res) { | |
res.json(200, staff); | |
}); |
This file contains hidden or 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
server { | |
server_name domain.one; | |
root /path/to/folder; | |
location / { | |
index index.html index.htm; | |
} | |
location /foo { | |
proxy_pass http://localhost:XXXX; |
This file contains hidden or 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
app.get('/json', function(req, res) { | |
res.json(200, _.sample(proverbs)); | |
}); |
This file contains hidden or 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
// Set the JSON source | |
var filepath = path.join(__dirname, '/proverbs.json'); | |
// Parse the JSON source as JSON | |
var proverbs = JSON.parse(fs.readFileSync(filepath)); | |
// Function to randomly sort the resulting object and return item 0 | |
function randomProverb() { | |
var shuffled = proverbs; | |
return shuffled.sort(function() { |
This file contains hidden or 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/local/bin/node | |
process.stdout.write('Hello world!'); |
This file contains hidden or 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
// Load the lessons for the current user | |
function getLessons() { | |
var data = loadDB(); | |
var records = _.rest(data, [1]); | |
var lessons = records.filter(function (e) { | |
var staff = getStaff(); | |
return (staff[e.whatIsTheNameOfTheTeacherObserved] === getCurrentUser()); | |
}); |
This file contains hidden or 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
<div id="header-block"> | |
<h1 id="hero">Lessons Observed</h1> | |
<div id="user"><strong>Logged in as: </strong><span id="current-user">Loading...</span></div> | |
</div> | |
<div id="container"> | |
<div id="observed-lesson"> | |
<h2 id="observed-teacher"></h2> | |
<h3 id="date-period"></h3> |