Skip to content

Instantly share code, notes, and snippets.

View mcewen87's full-sized avatar

Jon McEwen mcewen87

View GitHub Profile
@mcewen87
mcewen87 / demo.sql
Created January 11, 2024 23:24
Demo Data
-- *****************
-- CREATE ALL OF THE TABLES FOR THE DEMO DATABASE
CREATE TABLE users(
id serial PRIMARY KEY,
name varchar(50),
email varchar(50),
age integer,
nickname varchar(50),
@mcewen87
mcewen87 / automation_downloads.py
Created July 23, 2022 20:23
Simple python downloads folder automation script
import os
from pathlib import Path
downloads = Path("/Users/yourUserName/downloads")
# 👇🏻 lists of extension types
images = ['.bmp', '.gif', '.ico', '.jpeg', '.jpg', '.png', '.jfif', '.svg', '.tif', '.tiff']
data = ['.xls', '.xlsx', '.csv']
pdfs = ['.pdf']
create table sales_rep_calls (
id INT,
sales_rep VARCHAR(6),
call_date DATE,
outcome VARCHAR(7),
client_id INT
);
insert into sales_rep_calls (id, sales_rep, call_date, outcome, client_id) values (1, 'Ginger', '14-May-2021', 'no sale', 9);
insert into sales_rep_calls (id, sales_rep, call_date, outcome, client_id) values (2, 'Robert', '05-Feb-2022', 'no sale', 7);
insert into sales_rep_calls (id, sales_rep, call_date, outcome, client_id) values (3, 'Javier', '13-Jul-2021', 'sale', 2);
create table sales_rep_calls (
id INT,
sales_rep VARCHAR(6),
call_date DATE,
outcome VARCHAR(7),
client_id INT
);
insert into sales_rep_calls (id, sales_rep, call_date, outcome, client_id) values (1, 'Ginger', '14-May-2021', 'no sale', 9);
insert into sales_rep_calls (id, sales_rep, call_date, outcome, client_id) values (2, 'Robert', '05-Feb-2022', 'no sale', 7);
insert into sales_rep_calls (id, sales_rep, call_date, outcome, client_id) values (3, 'Javier', '13-Jul-2021', 'sale', 2);
//demoLogger.js
let stackPosition = null;
function repeat(N) {
if (stackPosition != null) {
console.log("Entering New Recursive Function");
}
if (stackPosition === null) {
console.log("Entering Intial Function Call");
import React from 'react';
import uuid from 'uuid';
import { createStore } from 'redux';
function reducer(state, action) {
return {
activeThreadId: activeThreadIdReducer(state.activeThreadId, action),
threads: threadsReducer(state.threads, action),
};
}
@mcewen87
mcewen87 / gist:66b1a49b7b9f23567d425221497f4a97
Created March 20, 2019 23:40
Saving my boilerplate code for Draft.js editor and markdown conversion
import React, { Component } from "react";
import { Editor, EditorState, RichUtils, convertToRaw } from "draft-js";
import Markdown from "react-remarkable";
import { stateToMarkdown } from "draft-js-export-markdown";
import "../App.css";
class EntryBox extends Component {
constructor(props) {
super(props);
this.state = {
import React, { Component } from 'react';
import './App.css';
class Rankings extends Component {
constructor() {
super();
this.state = {
items: [],
key: [],