Skip to content

Instantly share code, notes, and snippets.

View rwatts3's full-sized avatar
💭
Engineering Stuff

Ryan Watts rwatts3

💭
Engineering Stuff
View GitHub Profile
@rwatts3
rwatts3 / foo
Created July 20, 2021 21:34
test
‎‎​
@rwatts3
rwatts3 / redirects.json
Created February 21, 2019 17:08
catalina-redirects
{
"redirectDomains": [
{
"domains": [
"catalinachamber.com",
"www.catalinachamber.com",
"avalonchamber.com",
"www.avalonchamber.com",
"catalinaislandchamber.com",
"www.catalinaislandchamber.com",
@rwatts3
rwatts3 / file.R
Created January 23, 2019 18:32
gaQuery
data1 <- google_analytics(
viewId = gaviewId,
date_range = c(previousDay, previousDay),
dimensions = c("ga:campaign", "ga:sourceMedium", "ga:deviceCategory", "ga:country", "ga:city", "ga:dateHour", "ga:userGender"),
metrics = c("ga:pageViews", "ga:sessions"),
filtersExpression = "",
samplingLevel = "SMALL"
)

Using Vue in Production

Error Reporting Example.

This could also be wrapped in the conditional above with true being live environment and false being dev environment.


Inside your require block where you're instantiating Vue or using Vue at all this is a great thing to add.

@rwatts3
rwatts3 / panel_jumplist_outer.html
Created August 23, 2018 22:00
Jump List Panel Horizontal Styling.
<style>
.panel_jumplist_outer [data-seo-top] {
display: table;
width: 100%;
text-align: center;
clear: both;
}
.panel_jumplist_outer [data-seo-top] ol,
.panel_jumplist_outer [data-seo-top] ul {
list-style: none;
@rwatts3
rwatts3 / practice-sets.ipynb
Last active July 15, 2018 22:46
practice-sets.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
component output="false" displayname="Schema" hint="Functions to build valid schema.org" {
public function buildGeo(required details) {
local.data = arguments.details;
local.schemaObj = {};
local.schemaObj = {
"geo" = {
"@type" = "GeoCoordinates",
"latitude" = local.data.latitude,
@rwatts3
rwatts3 / example.js
Created November 20, 2017 22:42
Examples for using $.getJSON
var foo = null;
$.getJSON(.....).then( (myData) => {
console.log(myData);
// or assign some data here.
foo = myData;
});
$.getJSON(.....).then( function(myData) {
console.log(myData);
@rwatts3
rwatts3 / Avoiding a loop.R
Created October 23, 2017 18:05 — forked from dsparks/Avoiding a loop.R
lapply() as an alternative to a multiply-nested loop
# Alternative to a doubly-nested loop
# Imagine I want to perform an operation on a data frame
# once for each combination of two variables, such as Country and Year
# I can do this with a nested loop, or I can do this with (among other
# things) lapply()
# Generate random data:
allCountries <- LETTERS[1:10]
allYears <- 1990:2012
@rwatts3
rwatts3 / Avoiding a loop.R
Created October 23, 2017 18:05 — forked from dsparks/Avoiding a loop.R
lapply() as an alternative to a multiply-nested loop
# Alternative to a doubly-nested loop
# Imagine I want to perform an operation on a data frame
# once for each combination of two variables, such as Country and Year
# I can do this with a nested loop, or I can do this with (among other
# things) lapply()
# Generate random data:
allCountries <- LETTERS[1:10]
allYears <- 1990:2012