Skip to content

Instantly share code, notes, and snippets.

🍝
unfurling wet spaghetti

Kyle Taylor kyletaylored

🍝
unfurling wet spaghetti
Block or report user

Report or block kyletaylored

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kyletaylored
kyletaylored / .codeclimate-1.yml
Last active Nov 7, 2019
Drupal 8 Codeclimate
View .codeclimate-1.yml
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:
View pantheon-wow.js
// ==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==
View lighthouse.json
{
"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 / adwords_platform_app_namer.py
Created Sep 13, 2019
Get actual mobile app information from Adwords platform domain IDs.
View adwords_platform_app_namer.py
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 / sitemapper.php
Last active May 14, 2019
just scratch pad for now
View sitemapper.php
<?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 / .codeclimate.yml
Created Apr 25, 2019
Codeclimate base for Drupal 7
View .codeclimate.yml
---
version: "2"
plugins:
phpmd:
enabled: true
config:
file_extensions:
- php
- inc
- module
@kyletaylored
kyletaylored / go.sh
Created Apr 22, 2019
Combine access.log files and run GoAccess report at the same time.
View go.sh
input="goaccess.log"
output="goaccess.html"
touch $input
for var in "$@"
do
cat $var >> $input
done
goaccess $input -o $output --log-format=COMBINED
@kyletaylored
kyletaylored / parser.php
Created Apr 19, 2019
Sitemap XML De-duplicator
View parser.php
<?php
$xml=simplexml_load_file("sitemap.xml") or die("Error: Cannot create object");
$storage = [];
$xmltxt = fopen("xml.txt", "w");
$count = $skipped = 0;
// Normalize and remove duplicates.
foreach ($xml as $sxe) {
$count++;
$loc = strtolower($sxe->loc);
@kyletaylored
kyletaylored / loader.js
Last active Feb 14, 2019
Load scripts with JS
View loader.js
// Load JS function
var loadJS = function(url, callback){
var scriptTag = document.createElement('script');
scriptTag.src = url;
scriptTag.onload = callback;
scriptTag.onreadystatechange = callback;
document.body.appendChild(scriptTag);
};
// Load CSS function
@kyletaylored
kyletaylored / get_loc.js
Last active Feb 8, 2019
Get public ip location data using jQuery or Vanilla JS
View get_loc.js
// jQuery
(function($) {
$(document).ready(() => {
$.get("https://ipinfo.io/json").done((loc) => {
console.log(loc);
});
})
})(jQuery);
// Fetch (VanillaJS)
You can’t perform that action at this time.