Skip to content

Instantly share code, notes, and snippets.

View mqschwanda's full-sized avatar

Mark Q Schwanda mqschwanda

View GitHub Profile
@mqschwanda
mqschwanda / tennisTournaments.ts
Created August 11, 2024 04:44
Scrape DK example
import type { Resolvers } from 'lib/utility/apollo';
import { TennisAssociation } from 'lib/api/graphql/__generated__/graphql';
import * as cheerio from 'cheerio';
const TENNIS_TOP_LEAGUES = ['ATP', 'WTA', 'CHALLENGER'];
const DOUBLES_LEAGUES = ['DOUBLES'];
const ATP_LEAGUES = ['ATP', '(M)', 'CHALLENGER'];
// const BEST_OF_FIVE_LEAGUES = ['FRENCH OPEN', 'US OPEN', 'WIMBLEDON', 'AUSTRALIAN OPEN'];
const DRAFTKINGS_URL_BASE = 'https://sportsbook.draftkings.com';
@mqschwanda
mqschwanda / composer.json
Created May 13, 2022 21:02
Example for WordPress coding standards in PHP 8
{
"name": "mqschwanda/wordpress-phpcodesniffer",
"description": "Example for WordPress coding standards in PHP 8",
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
"phpcsstandards/phpcsextra": "dev-develop",
"phpcsstandards/phpcsutils": "dev-develop",
"wp-coding-standards/wpcs": "dev-develop"
},
"repositories": [
@mqschwanda
mqschwanda / cloudSettings
Created January 21, 2019 05:40
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-01-17T01:40:16.988Z","extensionVersion":"v3.2.4"}
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@mqschwanda
mqschwanda / fix-exif-orientation.js
Last active July 27, 2017 17:17
Fix exif image orientation issue
/*
SETUP:
npm install data-uri-to-u8@~1.0.0 exif-component@0.0.2 jpeg-size@0.0.1 png-size@~0.1.0 rotate-component@~1.0.0
USE FUNCTION:
fixExifOrientation(imageFile).then((file) => {
// do something with the javascript file object...
}).catch((error) => {
// do something with the error...
});
@mqschwanda
mqschwanda / .eslintrc
Last active February 20, 2018 00:37
atom sync settings
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"react"
@mqschwanda
mqschwanda / promise.js
Last active July 13, 2017 04:56
Promise wrapped HTTP GET request with timeout
/*
1. install the `bluebird` module globaly with npm:
npm install bluebird -g
2. run file and pass the testing time in millesconds as a flag:
TIMEOUT=1 node promise.js # should reject from timeout
TIMEOUT=1000 node promise.js # should resolve from response
*/
/*
# RUBY FILE
# script restarts localtunnel on a failure
require 'optparse'
options = {:subdomain => 'defaultdomain', :port => 3000}
parser = OptionParser.new do|opts|
opts.banner = "Usage: localtunnel.rb [options]"
opts.on('-s', '--subdomain subdomain', 'Subdomain') do |subdomain|
@mqschwanda
mqschwanda / RubySetup.md
Last active January 25, 2017 16:34
Gems

##RVM

# download RVM from terminal
curl -L get.rvm.io | bash
# after this is complete execute the source comand in order to use RVM in your current shell 
source ~/.rvm/scripts/rvm

If you find you are having issues with rvm CLI returning a "comman not found" error add source ~/.rvm/scripts/rvm to your ~/.bash_profile or you can run source /Users/<USERNAME>/.rvm/scripts/rvm