Skip to content

Instantly share code, notes, and snippets.

View joshgrib's full-sized avatar
🤔
coding

Josh Gribbon joshgrib

🤔
coding
View GitHub Profile
@joshgrib
joshgrib / create-daily-task-list.js
Created December 22, 2022 22:44
Daily task list script
/**
* A script to create a new daily task list and open it
*
* File is created in ./daily-task-lists/YYYY/MM with the
* file name DD-<day letter code>.md
*
* Imports the tasks from the last task list and puts them
* under a `Yesterday` header, then creates a `Today`
* heading and opens the file in VSCode for editing
*
@joshgrib
joshgrib / ResizingWrapper.vue
Created February 16, 2022 21:03
A Vue component to wrap another and change size to help debug sizing issues without having to resize the window
<template>
<div id="sandbox">
<slot />
</div>
</template>
<script>
/**
* A component to wrap another and change size to debug sizing issues without
* having to manually resize the window
@joshgrib
joshgrib / create-daily-task-list.js
Created September 14, 2021 01:20
Create a daily task list, importing the tasks from yesterday and creating a new file with the date
/**
* A script to create a new daily task list and open it
*
* File is created in ./daily-task-lists/YYYY/MM with the
* file name DD-<day letter code>.md
*
* Imports the tasks from the last task list and puts them
* under a `Yesterday` header, then creates a `Today`
* heading and opens the file in VSCode for editing
*
@joshgrib
joshgrib / cloudSettings
Created November 13, 2018 21:36
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-11-13T21:36:20.693Z","extensionVersion":"v3.2.0"}

Keybase proof

I hereby claim:

  • I am joshgrib on github.
  • I am joshgrib (https://keybase.io/joshgrib) on keybase.
  • I have a public key ASBujCAiQbwj_IswmSAn97oeMV5Jou2vSLJchVc2_OaqHgo

To claim this, I am signing this object:

// Single Person Page
router.get("/:id", (req, res) => {
// Find a person by the provided id,
// then display their information
// As well as listing all events that they will be attending
// Each of these events need to link to the event page, and show the event name
// If a person is not found, display the 404 error page
data.people.getPerson(req.params.id).then( (person_info) => {
return data.events.getEventsForAttendee(person_info.id).then( (event_info) => {
person_info.events = event_info;
getEventsForAttendee: (attendeeId) => {
if (attendeeId === undefined) return Promise.reject("No attendee id provided");
let clone = JSON.parse(JSON.stringify(eventList));
return Promise.resolve(clone.filter(x => x.attendees.indexOf(attendeeId) >= 0));
},
getEventsForLocation: (locationId) => {
if (locationId === undefined) return Promise.reject("No location id provided");
let clone = JSON.parse(JSON.stringify(eventList));
getCommentById(id){
return recipeData.getAllRecipes().then( (all_recipes) => {
resp_comment = {};
all_recipes.forEach( (recipe) => {
recipe.comments.forEach( (comment) => {
if(comment._id === id){
resp_comment = {'_id':id, 'recipeId':recipe._id, 'recipeTitle':recipe.title, 'comment':comment.comment, 'poster':comment.poster};
}
});
});
#generated binary reflected gray codes in two ways
def BRGC(n):
"""
Return list of binary reflected gray codes changing one bit at a time
"""
if n is 1:
return ['0', '1']
else:
L1 = BRGC(n-1)