This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useEffect, useRef } from 'react'; | |
import { useTracker } from 'meteor/react-meteor-data'; | |
import { Grapher } from 'meteor/cultofcoders:grapher'; | |
import { Meteor } from 'meteor/meteor'; | |
interface QueryInfo<T> { | |
loading: boolean | |
ready: boolean | |
data: T[] | |
error: Meteor.Error | null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This isn't comprehensive and is a pretty dirty hack piece of code, | |
// but it gets you close when you have a ton of fields in mongo | |
// collection documents that you need to create interfaces for | |
function makeTypes(obj: { [key: string]: any }, depth: number = 0) { | |
if (obj) { | |
let types: string = ''; | |
Object.keys(obj).forEach((key) => { | |
const value = obj[key]; | |
if (value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){ | |
const vdo = document.getElementsByTagName("video")[0]; | |
vdo.pause(); | |
const vdoUrl = vdo.src | |
const link = document.createElement('a'); | |
link.href = vdoUrl; | |
link.target= '_blank'; | |
const paths = location.pathname.split('/'); | |
const e = document.createEvent('MouseEvents'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
entry: "./src/main.js", | |
output: { | |
filename: "./dist/bundle.js" | |
}, | |
module: { | |
rules: [ | |
{ | |
test: [/\.js$/, /\.es6$/], | |
exclude: /node_modules/, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*This program is intended to help you refresh your memory with programming in C++ and consists only of concepts from 146. | |
Write a program that reads the appropriate number of integers into an array, and sorts these numbers in reverse order | |
(decreasing order). The data will consist of 3 sets of data (Please use a loop instead of running the program 3 times). | |
Each set of data begins with an integer that indicates the number of integers on the next newline that are to be read | |
and sorted. So, unnecessary (i.e., to be ignored-not sorted)numbers may exist in the data. | |
The 3rd and 5th will be set up like the 1st. Likewise, the 4th and 6th will be set up like the 2nd. | |
Requirements: | |
Function to print the array of numbers; pass be value must be used |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Join into single line and add to chrome or firefox as a bookmark and run on lynda video page with html5 video enabled | |
//will not work with lynda's flash video player | |
javascript:(function(){ | |
var vdoUrl = $("video").attr("h264"); | |
var link = document.createElement('a'); | |
link.href = vdoUrl; | |
var fileName = vdoUrl.substring(vdoUrl.lastIndexOf('/') + 1, vdoUrl.length); | |
link.download = fileName; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Fiber = Npm.require('fibers') | |
var Server = Meteor.npmRequire('bittorrent-tracker').Server; | |
Tracker = function () { | |
Server.prototype.constructor.call(this); | |
}; | |
Tracker.prototype = Object.create(Server.prototype); | |
Tracker.prototype.constructor = Tracker; | |
Tracker.prototype.getSwarm = function (infoHash) { | |
if (Buffer.isBuffer(infoHash)) infoHash = infoHash.toString('hex'); | |
var torrent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UI.registerHelper('eachIndex', function () { | |
var withIndex = this.map(function(x, i) { | |
return {data: x, index: i} | |
}); | |
return UI.Each( | |
function() { | |
return withIndex; | |
}, UI.block(null), UI.block(null)); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.publish('userData', function() { | |
if(!this.userId) return null; | |
return Meteor.users.find(this.userId, {fields: { | |
mmmelons: 1, | |
}}); | |
}); |
NewerOlder