Skip to content

Instantly share code, notes, and snippets.

View neurotech's full-sized avatar
🍔
We codin'

Tim Douglas neurotech

🍔
We codin'
View GitHub Profile
var results;
function doPoll(){
$.getJSON('http://localhost:3000/period', function(data) {
results = data;
setTimeout(doPoll,5000);
});
};
doPoll();
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);
var proverbs = JSON.parse(fs.readFileSync(config.dictionary.proverbs));
console.log(_.sample(proverbs));
app.get('/keep/staff', function(req, res) {
res.json(200, staff);
});
server {
server_name domain.one;
root /path/to/folder;
location / {
index index.html index.htm;
}
location /foo {
proxy_pass http://localhost:XXXX;
app.get('/json', function(req, res) {
res.json(200, _.sample(proverbs));
});
// 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() {
@neurotech
neurotech / after.sh
Created March 26, 2014 04:04
No newline after expanding node script.
#!/usr/local/bin/node
process.stdout.write('Hello world!');
// 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());
});
<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>