Skip to content

Instantly share code, notes, and snippets.

View srinjoyc's full-sized avatar
👋

Srinjoy srinjoyc

👋
  • Dapper Labs
  • Vancouver, BC, Canada
View GitHub Profile
const deliveries = await DeliveryCollection.find({})
console.log(deliveries.length, 'length...')
const logger = fs.createWriteStream('result.txt', {
flags: 'a'
})
const allItems = []
deliveries.map(delivery => {
delivery.orderItems.map(item => {
if (item.creditIssued > 0) {
console.log(item.creditIssued)
@srinjoyc
srinjoyc / schema.js
Last active February 28, 2019 04:04
const seedData = () => {
const debt = [
{
'name': 'Alberta Student Loan',
'startDate': '2019-11-30',
'type': 'studentLoan', // mortgage or credit/loan or student loan
'payByTime': true, // true if calculation done by time
'payBackMonths': 114, // default 114 month(9.5y) for student loans, 300(25y) month for mortgage
'monthlyPayment': 0, // can increase this
'principalAmount': 90000,
import { Meteor } from 'meteor/meteor';
import { Income } from "../../collections/income.js";
import { Expense } from "../../collections/expense.js";
import { Debt } from "../../collections/debt.js";
import { Goal } from "../../collections/goal.js";
import _ from 'lodash';
import moment from 'moment';
// simple current user scoped queries
const getUserIncomes = (currUserId) => { return Income.find({ userId: currUserId }).fetch() }
/**
* @file binarytree.cpp
* Definitions of the binary tree functions you'll be writing for this lab.
* You'll need to modify this file.
*/
#include <iostream>
using namespace std;
var accountSid = 'ACdb188d718589293693090a2b05a7ca04'; // Your Account SID from www.twilio.com/console
var authToken = '24ebabb4aef0d0d22ba1692c537b5d5f'; // Your Auth Token from www.twilio.com/console
var twilio = require('twilio');
var client = new twilio(accountSid, authToken);
var request = require('request');
request('http://www.ugrad.cs.ubc.ca/~cs221/2017W1/', function(err, response, body) {
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
* {
font-family: 'PT Sans';
}
#page {
text-align: center;
background-color: lightgreen;
}
#game-container{
display: inline-block;
}
(function (money) {
var guessCheck = function(bet,guess,correct){
var correctGuess = correct === guess;
var oneOff = (guess===correct-1 || guess===correct+1)
if (oneOff){
alert('close, so money lost!');
}
else{
money = moneyManager(money, bet, correctGuess ? 'won' : 'lost');
var arrayOfLight = function(x){
var arr = [];
for(var i=0; i <= x; i++){
arr[i] = i;
}
return arr;
}
console.log(arrayOfLight(88));