Skip to content

Instantly share code, notes, and snippets.

class Food {
/**
* @param {Boolean} [isDelicious=false]
*/
constructor(isDelicious) {
this.isDelicious = isDelicious;
}
/**
{
init: function(elevators, floors) {
var floorCnt = floors.length
var elevatorCnt = elevators.length
var chunkSize = floorCnt / elevatorCnt
var direction = 0
var waitQueue = {}
var pushQueue = {}
var loadMax = 0.00
var loadMin = 1.00
@kevinwritescode
kevinwritescode / 0_reuse_code.js
Created April 4, 2016 22:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// COURSE
// isVoiceBiometricsVerification Is Voice Verification required (Voice Vault) FL.DE, TX.ADE, OH.DE, IL.DE
// allowedVerificationFailureCount Number of allowed failures until a lock action TX.ADE, OH.DE, IL.DE
// isBlockedOnVerificationFailure Do not record failures, perform lock action each time FL.DE
// requireIDVerification Is Knowledge Verification required (Block Score) TX.DD
// verificationAttemptCount Number of repeat tries per single verification attempt TX.ADE, FL.DE, OH.DE, IL.DE
// verificationOverridePercentage Randomly override failures for leniancy
// verifyFailAction Action to take on a failure, TIMEDLOCK, LEVELRESET OH.DE, FL.DE, IL.DE
// verifyLockSeconds How long to lock for on TIMEDLOCK action OH.DE
@kevinwritescode
kevinwritescode / !Wrapping-Express-Router.md
Last active August 29, 2015 14:11
Wrapping Express Router

I love using Express 4's Router for rapid API development, but I hate having to link existing functions to the router.use() function by mapping req.body properties to the function parameters. So I wrote the following script, which will automatically map each property. Additionally, if you have parameters called req or res, it will reserve those words to pass the routers parameters directly.

Note that this implementation assumes any function being called will return a Q promise. It will also return a default status of 500 for any error thrown by the function, unless overridden.

#!/bin/bash
# Download and Build Every Company Site
# @author Kevin Nuut
USER_HOME=$(eval echo ~${SUDO_USER})
base="/var/www/"
confd="/var/www/confd/"
log="/var/log/company/"
$('.ajaxloader').change(function(e) {
e.preventDefault();
console.log('top leveler');
var value = $(this).val();
var child = $(this).attr('data-child');
var ajaxurl = $(this).attr('data-ajax');
if (child && ajaxurl) {
// If a user tops-up with a PIN product and forget to supply their phone, set it for them
if (!$phone && !empty($response['pin'])) {
$phone = $lookup['topupphone'];
}
if ($style == 'created') {
$sql .= " AND s.chg_tot < 10";
$sql .= " AND (s.chg_tot > 0 OR s.credit = 1 OR s.credit = 2)";
$sql .= " AND (s.last_date IS NULL OR s.last_date >= " . $db->quote($startDate) . ")";
$sql .= " AND s.cre_date BETWEEN " . $db->quote($startDate) . " AND " . $db->quote($endDate);
}
@kevinwritescode
kevinwritescode / gist:3425546
Created August 22, 2012 13:27
Checker Gradient
background-color: #f5f5f5;
background-image: -webkit-linear-gradient(45deg, rgba(256, 256, 256, 0.5) 25%, transparent 25%, transparent 75%, rgba(256, 256, 256, 0.5) 75%, rgba(256, 256, 256, 0.5)), -webkit-linear-gradient(45deg, rgba(256, 256, 256, 0.5) 25%, transparent 25%, transparent 75%, rgba(256, 256, 256, 0.5) 75%, rgba(256, 256, 256, 0.5));
background-size: 4px 4px;
background-position: 0 0, 2px 2px;