Skip to content

Instantly share code, notes, and snippets.

View scissorsneedfoodtoo's full-sized avatar

Kristofer Koishigawa scissorsneedfoodtoo

View GitHub Profile
@scissorsneedfoodtoo
scissorsneedfoodtoo / AsyncStripeProvider.js
Created December 8, 2020 14:28 — forked from mrcoles/AsyncStripeProvider.js
A react provider abstraction for loading the stripe.js file asynchronously to use with Stripe Elements
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { StripeProvider } from 'react-stripe-elements';
export default class AsyncStripeProvider extends Component {
static propTypes = {
apiKey: PropTypes.string.isRequired
};
// constructor
@scissorsneedfoodtoo
scissorsneedfoodtoo / tagsCount.json
Created September 25, 2020 12:06
/news tags count
[
{
"name": "Tech",
"url": "https://www.freecodecamp.org/news/tag/tech/",
"count": 2778
},
{
"name": "Programming",
"url": "https://www.freecodecamp.org/news/tag/programming/",
"count": 2738
@scissorsneedfoodtoo
scissorsneedfoodtoo / Registration of New Users
Created August 11, 2020 13:02
Testing with fetch instead of ajax
---
id: 58966a17f9fc0f352b528e6d
title: Registration of New Users
challengeType: 2
isHidden: false
forumTopicId: 301561
---
## Description
<section id='description'>
@scissorsneedfoodtoo
scissorsneedfoodtoo / server.js
Created August 11, 2020 07:37
Advanced Node and Express - Registration of New Users
"use strict";
require('dotenv').config()
const express = require("express");
const myDB = require('./connection');
const fccTesting = require("./freeCodeCamp/fcctesting.js");
const session = require('express-session');
const passport = require('passport');
const ObjectID = require('mongodb').ObjectID;
const LocalStrategy = require('passport-local');
@scissorsneedfoodtoo
scissorsneedfoodtoo / server.js
Last active August 11, 2020 07:13
Advanced Node and Express - How to Use Passport Strategies
'use strict';
require('dotenv').config();
const express = require('express');
const session = require('express-session');
const passport = require('passport');
const LocalStrategy = require('passport-local');
const ObjectID = require('mongodb').ObjectID;
const myDB = require('./connection');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
@scissorsneedfoodtoo
scissorsneedfoodtoo / server.js
Last active August 11, 2020 07:14
Advanced Node and Express - Implement the Serialization of a Passport User
'use strict';
require('dotenv').config();
const express = require('express');
const session = require('express-session');
const passport = require('passport');
const ObjectID = require('mongodb').ObjectID;
const myDB = require('./connection');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
@scissorsneedfoodtoo
scissorsneedfoodtoo / server.js
Last active August 11, 2020 07:14
Advanced Node and Express - Set up Passport
'use strict';
require('dotenv').config();
const express = require('express');
const session = require('express-session');
const passport = require('passport');
const ObjectID = require('mongodb').ObjectID;
const myDB = require('./connection');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
import random
class Card:
def __init__(self, suit, rank):
self.suit = suit
self.rank = rank
def __str__(self):
return f"{self.rank['rank']} of {self.suit}"
@scissorsneedfoodtoo
scissorsneedfoodtoo / index.js
Last active May 8, 2019 05:44
Tried to tidy up karuppiah7890's view counter
const MockXMLHttpRequest = require('mock-xmlhttprequest');
const server = MockXMLHttpRequest.newServer({
get: ['/views', function (xhr) {
let count = 0;
if (typeof (Storage) !== "undefined") {
count = Number(localStorage.getItem("count"));
} else {
console.log('Sorry! No Web Storage support for this browser. This web page will not function properly');
}
@scissorsneedfoodtoo
scissorsneedfoodtoo / index.js
Created April 29, 2019 04:31
playing with HKuz's world map tooltip
// Set up tooltip
const tooltip = d3.select("#tooltip")
.style("display", "none")
.classed("tooltip", true);
// Draw the map and add tooltip functionality
g.selectAll(".countries")
.data(countries)
.enter().append("path")
.attr("class", "countries")