Skip to content

Instantly share code, notes, and snippets.

View Noble-Mushtak's full-sized avatar

Noble Mushtak Noble-Mushtak

View GitHub Profile
@Noble-Mushtak
Noble-Mushtak / website.js
Created August 8, 2015 16:04
Lightweight Dropdowns:
//The event names. These change according to whether or not the user is on a mobile device, or specifically a Windows Phone.
var isIEMobile = navigator.userAgent.indexOf("IEMobile") != -1;
var isMobile = navigator.userAgent.indexOf("Mobile") != -1;
var mouseevents = {
click: "click",
mousedown: isIEMobile ? "pointerdown" : (isMobile ? "touchstart" : "mousedown"),
mouseup: isIEMobile ? "pointerup" : (isMobile ? "touchend" : "mouseup"),
mousemove: isIEMobile ? "pointermove" : (isMobile ? "touchmove" : "mousemove"),
mouseenter: isIEMobile ? "pointerenter" : (isMobile ? "touchenter" : "mouseenter"),
mouseleave: isIEMobile ? "pointerleave" : (isMobile ? "touchleave" : "mouseleave")
/*
* Step 1: Check to make sure user is logged in (if not, leave page)
* Step 2: Check to make sure logged in user, is an administrator (if not, leave page)
* Step 3: Load all tools onto the page.
*/
/* The data we have on the current user. */
var userData;
/* True iff we're done with the auth checks. */
var authChecksDone = false;
@Noble-Mushtak
Noble-Mushtak / bot.js
Last active August 29, 2015 14:25
KA Contest Judging System Server Bot
//Include Firebase and jQuery AJAX
var http = require("http");
var Firebase = require("Firebase");
var najax = require("najax");
var minuteInterval = 30;
var howOften = 60 * 1000 * minuteInterval; //Should evaluate to "minuteInterval" minutes
//ka_api.js
/***
@Noble-Mushtak
Noble-Mushtak / code.txt
Created July 20, 2015 14:57
Link to KA Embed Code
data:text/html,<h2><a href="https://www.khanacademy.org/computer-programming/what-is-it-adjustable/4857201710727168">What is it? (adjustable)</a></h2> <script src="https://www.khanacademy.org/computer-programming/what-is-it-adjustable/4857201710727168/embed.js?editor=yes&amp;buttons=yes&amp;author=yes&amp;embed=yes"></script> <p>Made using: <a href="http://www.khanacademy.org/computer-programming">Khan Academy Computer Science</a>.</p>