Skip to content

Instantly share code, notes, and snippets.

@MiladNazeri
MiladNazeri / miladsDb.js
Last active November 18, 2016 03:56
Going over some basic Sequelize/Express stuff
//npm i body-parser express pg pg-hstore sequelize
//postgres - RDBMS - our database server for handeling SQL over TCP/IP
//PG - our connection between postgress and PG
//Sequelize - our ORM that behind the scenes uses pg but gives us the power of javascript objects to use our database with properties and methods
const express = require('express');
//Create instance of express
const app = express();
//To help us turn the body from a request into a JS object
const bodyParser = require('body-parser');
const sequelize = require('sequelize');
@MiladNazeri
MiladNazeri / track.js
Last active October 10, 2017 13:45
Helper to capture data in a script
//trying to find ou issues with sim performance.
//Chris Collins 1/14/2017
(function() {
var _this = this;
// The url of the macro
var STAT_GOOGLE_SCRIPT_URL = "https://script.google.com/macros/s/AKfycbxxphmPhZHAL9rwckMPrJp6bOsJYRiRCeLZkefyINnGZaxA8cY/exec";
// Send the data every:
@MiladNazeri
MiladNazeri / raycast.js
Created January 11, 2019 00:10
#hifi #raycast Raycasting code for controllers and mouse button
var lastMouseX;
var lastMouseY;
// Record the last mousePressEvent
function mousePressEvent(event) {
lastMouseX = event.x;
lastMouseY = event.y;
}
@MiladNazeri
MiladNazeri / reload-failing-server-scripts.js
Created January 31, 2019 00:12 — forked from Atlante45/reload-failing-server-scripts.js
Tracks down and reloads failing entity server scripts.
var entitiesWithServerScripts = 0
function callbackClosure(i, callback) {
return function() {
return callback(i);
}
}
var interval = Script.setInterval(function() {
console.log("Checks pending:", entitiesWithServerScripts)