Skip to content

Instantly share code, notes, and snippets.

View kyletaylored's full-sized avatar
🍝
unfurling wet spaghetti

Kyle Taylor kyletaylored

🍝
unfurling wet spaghetti
View GitHub Profile
@kyletaylored
kyletaylored / .codeclimate.yml
Created April 25, 2019 18:02
Codeclimate base for Drupal 7
---
version: "2"
plugins:
phpmd:
enabled: true
config:
file_extensions:
- php
- inc
- module
@kyletaylored
kyletaylored / sitemapper.php
Last active May 14, 2019 21:43
just scratch pad for now
<?php
if (php_sapi_name() == 'cli' && empty($argv[1])) {
dd("Pass a file name as an argument. \n\n ./index.php filename.csv");
}
//*********** Sitemap Processor Class ***********
class SitemapProcessor {
private $paths;
private $json;
@kyletaylored
kyletaylored / adwords_platform_app_namer.py
Created September 13, 2019 05:36
Get actual mobile app information from Adwords platform domain IDs.
import csv
import requests
import json
import time
from pprint import pprint
itunes = "https://api.appmonsta.com/v1/stores/itunes/details/"
android = "https://api.appmonsta.com/v1/stores/android/details/"
api_key = "API_KEY"
@kyletaylored
kyletaylored / lighthouse.json
Created October 2, 2019 20:38
Sample Lighthouse
{
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36",
"environment": {
"networkUserAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3694.0 Mobile Safari/537.36 Chrome-Lighthouse",
"hostUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36",
"benchmarkIndex": 748
},
"lighthouseVersion": "5.4.0",
"fetchTime": "2019-10-02T20:38:03.459Z",
"requestedUrl": "http://dev-example-site-1.pantheonsite.io/",
@kyletaylored
kyletaylored / .codeclimate-1.yml
Last active November 7, 2019 18:38
Drupal 8 Codeclimate
exclude_paths:
- "/vendor/*"
engines:
phpcodesniffer-drupal:
enabled: true
config:
file_extensions: "php,module,inc,install,test,profile,theme,js,css,info,txt,md"
standard: "Drupal,DrupalPractice"
ratings:
paths:
@kyletaylored
kyletaylored / vcl_error
Created March 5, 2020 20:47
DU Redirect VCL
if (obj.status == 902) {
set obj.status = 301;
set obj.http.location = "https://domain.com" obj.response;
set obj.response = "Moved Permanently";
synthetic {""};
return (deliver);
}
@kyletaylored
kyletaylored / pantheon-mysql-dashboard-link.js
Last active March 23, 2020 17:34
Add MySQL link in Pantheon dashboard
@kyletaylored
kyletaylored / rename.py
Created May 11, 2020 16:16
Python renaming script (specific use case)
# Python 3 code to rename multiple
# files in a directory or folder
# importing os module
import os
from shutil import copyfile
# Function to rename multiple files
def main():
@kyletaylored
kyletaylored / ipinfo.py
Last active May 19, 2020 22:39
IPInfo script for GeoIP detection
import requests
from dotenv import load_dotenv
from netaddr import IPAddress
import os
import pickledb
import codecs
import csv
import argparse
from tqdm import tqdm
from pprint import pprint
// ==UserScript==
// @name Pantheon WebOps Trick
// @namespace https://kyletaylor.dev
// @version 0.3
// @description Always be wow-ing.
// @author Kyle Taylor
// @match https://dashboard.pantheon.io/sites/*
// @grant none
// ==/UserScript==