Skip to content

Instantly share code, notes, and snippets.

View JeremyIglehart's full-sized avatar

Jeremy Iglehart JeremyIglehart

  • Downingtown, PA
View GitHub Profile
@JeremyIglehart
JeremyIglehart / React Countdown Componant Performance Study.md
Last active August 18, 2016 01:16
React Countdown Component Performance Study

Hello Fellow React Peoples,

I finally finished my basic <Countdown /> componant. You use it like this:

<CountdownTimer start={someJSDate} end={someOtherJSDate} />

Here's the code for the component:

No Throttle:

@JeremyIglehart
JeremyIglehart / countdown.jsx
Created August 17, 2016 23:43
React Countdown Timer with Performance Enhancements
import React, { Component } from 'react'
import moment from 'moment'
// This component is called like so:
// <CountdownTimer start={Date()} end={Date()} />
class CountdownTimer extends Component {
constructor(props) {
super(props)
@JeremyIglehart
JeremyIglehart / The Commandment to Be Baptized.md
Last active August 16, 2016 00:01
The Commandment to Be Baptized
  • Why must we be baptized?

For teachers: Use questions at the beginning of a section to start a discussion and send class members or family members to the text to find more information. Use questions at the end of a section to help class members or family members ponder and discuss the meaning of what they have read and apply it in their lives.


@JeremyIglehart
JeremyIglehart / Keeping The Sabbath Day Holy - Gospel Principles.md
Created August 14, 2016 04:48
Keeping The Sabbath Day Holy - Gospel Principles

Keep the Sabbath Day Holy

Lesson 4: The Commandments Preach My Gospel: A Guide to Missionary Service, (2004), 71–81

Our Sabbath-day behavior is a reflection of our commitment to honor and worship God. By keeping the Sabbath day holy, we show God our willingness to keep our covenants. Each Sabbath day we go to the Lord’s house to worship Him. While there we partake of the sacrament to remember Jesus Christ and His Atonement. We renew our covenants and show that we are willing to repent of our sins and mistakes. (Paragraph 73

On this day, we enjoy a rest from our labors. As we attend Church services and worship together, we strengthen each other. We are renewed by our association with friends and family. Our faith is strengthened as we study the scriptures and learn more abo

@JeremyIglehart
JeremyIglehart / discordErrors.txt
Created July 10, 2016 03:30
Discord Is Not Loading - Console Error Messages
7/9/16 11:29:41.172 PM lsd[235]: LaunchServices: Could not store lsd-identifiers file at /private/var/db/lsd/com.apple.lsdschemes.plist
7/9/16 11:29:41.329 PM com.apple.xpc.launchd[1]: (com.apple.xpc.launchd.domain.pid.WebContent.3365) Conflicts exist in System services. Randomly deciding: path1 = /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/XPCServices/com.apple.desktopservices.KeynoteConverterXPCService32.xpc, path2 = /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A_/XPCServices/com.apple.desktopservices.KeynoteConverterXPCService32.xpc
7/9/16 11:29:41.329 PM com.apple.xpc.launchd[1]: (com.apple.xpc.launchd.domain.pid.WebContent.3365) Conflicts exist in System services. Randomly deciding: path1 = /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/XPCServices/com.apple.desktopservices.KeynoteConverterXPCService64.xpc, path2 = /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A_/XPCServices/com.apple.desktop
@JeremyIglehart
JeremyIglehart / findWithinRange.js
Created July 5, 2016 21:19
Finding Max Price Within Different Ranges Of "PriceObject"
var priceObject = [
{
min: "1",
max: "100",
price: "0.5"
},
{
min: "101",
max: "500",
price: "0.2"
@JeremyIglehart
JeremyIglehart / TestingUnderscoreSample.js
Created June 17, 2016 20:25
A function which tests the distribution of _.sample()
// Option 1
(function(arraySize = 10, timesToRun = 1000){
let myArray = Array.apply(null, {length: arraySize}).map(Number.call, Number);
let resultsArray = Array.apply(null, Array(arraySize)).map(Number.prototype.valueOf,0);
for (let i = 0; i < timesToRun; i++) {
var result = _.sample(myArray);
resultsArray[result]++;
}
return resultsArray;
})(/*10, 1000*/);
@JeremyIglehart
JeremyIglehart / ResponseToCommentStackOverflow.md
Created June 8, 2016 22:01
Response to comment on a stackoverflow question

Response to comment on a stackoverflow question

@David Weldon: Thank you for your response. I reset the project, and this time instead of running that update from my browser, I ran it right within the fixtures.js (which is obviously run from the server on startup). I am happier with how things are going into mongo on this reset, but I still can't read my subdocument - it's as if I'm not updating them properly. I feel like they are not there at all.

Here is the relevant fixture.js content:

// The "elvesEpisodetwoId" is set above in the file, I didn't include it because we are not experiencing problems with that collection at all and I'm pretty sure my client would like me to keep some level of privacy as much as possible for the code.

// Add Filler Idea Posts for Elves of Our Lord
var elvesEpisodeTwoIdeaOneId = Ideas.insert({
@JeremyIglehart
JeremyIglehart / StackOverflowQuestionResponse.md
Last active June 8, 2016 21:51
This is output from a Meteor Project intended for a stackoverflow.com question

This is output from a Meteor Project intended for a stackoverflow.com question

@Michael Floyd: Here is the output from your suggestion.

".find() and .findOne() format slightly differently in the meteor mongo console, try the latter. Or try db.ideas.findOne(id).score" -

$ meteor mongo
MongoDB shell version: 2.6.7
connecting to: 127.0.0.1:3001/meteor
@JeremyIglehart
JeremyIglehart / howToUpdateArrayMongoDbMeteor.md
Last active June 8, 2016 12:11
How to Update An Array of Subdocuments on a MongoDB Collection in MeteorJS

How to Update An Array of Subdocuments on a MongoDB Collection in MeteorJS

This is a gist created for a comment to an answer provided on stackoverflow.com.

@David Weldon: Thanks for your answer. Below I edited my input, but got the below output. Maybe this is the default behavior of db.ideas.find(). I'll do some looking around. I expected to also get the subdocuments also when I performed the db.ideas.find().

Code I ran:

Ideas.update("bKXXrpYmppFBfq9Kx", {
  $addToSet: {