Skip to content

Instantly share code, notes, and snippets.

View mpaccione's full-sized avatar
🎯
Focusing

Michael Paccione mpaccione

🎯
Focusing
View GitHub Profile
@mpaccione
mpaccione / .js
Created May 5, 2021 22:29
api.js
import axios from "axios";
import { getToken } from "./storage";
//export const BASE = "http://204.197.4.33:8081/";
// export const BASE = !process.env.NODE_ENV || process.env.NODE_ENV === "development"
// ? 'http://localhost:8081/'
// : 'http://204.197.4.33:8081/';
export const BASE = !process.env.NODE_ENV || process.env.NODE_ENV === "development"
? 'http://0.0.0.0:8081/'
import React, { useState, useEffect } from "react";
import { useDispatch } from "react-redux";
import { withRouter } from "react-router-dom";
import Layout from "@/components/layout";
import ForgotPasswordModal from "./components/forgotPasswordModal/index.jsx";
import { Icon } from "semantic-ui-react";
import jwt_decode from "jwt-decode";
import googleIcon from "@/assets/icons/google.svg";
import fbIcon from "@/assets/icons/facebook.svg";
async function scrapeRecruiters(page) {
const recruiterJSON = [];
async function recursiveScrape(jobCountParam) {
try {
let jobCount = jobCountParam;
console.log({ jobCount });
if (jobCountParam === jobsJSON.length - 1) {
writeJobsToCSV(recruiterJSON);
} else {
const fs = require("fs");
const fetch = require("node-fetch");
let obj;
const file1 = "requestlog-charges.json";
const file2 = "requestlog-customer-charges.json";
// Read the local json reqeust responses store to variable
(function () {
const customerPointers = {};
@mpaccione
mpaccione / gist:600068e2a76874fdb998e730a319fac1
Created January 23, 2021 02:11
Relevant Code for Stripe confusion
useEffect(() => {
(async () => {
if (stripe === undefined) {
const stripeRes = await loadStripe(
"pk_test_51HrbUxAdAI21ldjmWDqxhD3t8hRrKMQ2WyshTOlNLGYEd4oWVoUrkIS0bKSYzpnCNoOtkpmFwzL62sF8IM8BDTeU00t0EK9JGA"
);
setStripe(stripeRes);
}
})();
dispatch(getActiveStripeSubscriptions());
@mpaccione
mpaccione / gist:35908d4b792e72772ff4f4cfa08db08f
Created June 23, 2020 00:06
Modal part of appliance_repeater.php
<!-- The Modal -->
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<span class="close">&times;</span>
<div class="modal-icon-wrap">
<div class="modal-icon">
<img class="modal-app-icon" src="" alt="Peak Icon">
</div>
@mpaccione
mpaccione / fastcgi-php.conf
Last active June 22, 2020 00:24
Fast CGI Config
# regex to splut $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
@mpaccione
mpaccione / gist:4a37558b0a89595897a82d794498fe51
Created July 31, 2019 18:16
Three.js Helicopter Collision Raycaster Issue
MAIN HELICOPTER CLASS
//////////////////////////////
/////////////////////////////
collisionDetection(){
console.log("collisionDetection()");
const obj = {
rayCasters: this.rayCasters,
collidableMeshList: window.collidableMeshList