Skip to content

Instantly share code, notes, and snippets.

View kylewest's full-sized avatar

Kyle West kylewest

View GitHub Profile
@kylewest
kylewest / custom-message-on-page-by-url.html
Created December 21, 2016 16:39
displays a custom message when url matches the regex in code.
<!-- put this code in custom html <head> section (Website Configuration) -->
<script type="text/javascript">
$(document).ready(function(){
if ( /b\-11854/i.test(window.location.href ) ) {
$("#allbrands").before("<div style='background:#FFF;text-align:center'><h2>We can get any Mazda parts.</h2><h2>Please <a href='/contact'>CONTACT US</a> if you don't see the parts that you need.</h2></div>");
}
});
</script>
@kylewest
kylewest / Build-Troys-Network.markdown
Created October 4, 2016 15:39 — forked from troyhunt/Build-Troys-Network
Help me spec out a replacement home network using Ubiquiti bits

That's it - I've finally lost it with Linksys and both my WRT 1900ACs that are only a year old are getting chucked. Don't get me started on all the reasons why, but it's primarily down to continued degradation of wifi signal and the constant need for reboots. Going by the responses to this tweet, that's just what they do: https://twitter.com/troyhunt/status/778867707655487488

I’m going all out with Ubiquiti instead. No, I'm not interested in [insert the other thing you think rocks here], there's a really vocal majority in favour of Ubiquiti so that's that. Now I need help speccing out what I need for my house as it’s not quite as straight forward as just chucking in a couple of (dodgy) routers.

Here’s what I’m working with:

  • Large multi-level house about 500m2 (needs at least 2 APs, probably more)
  • Wired ethernet to every room (I believe Cat 5e, was here when I got here)
  • Patch board in the garage and a 100Mbps hub (running patch cables out to a Linksys 8 port gigabit switch instead)
  • 4 wired connection
<!-- put this code in custom html <head> section (Website Configuration) -->
<script type="text/javascript">
$(document).ready(function(){
if ( /magnaflow/i.test($("h1").text()) ) {
$("#ctl00_MainContentPlaceHolder_YourPriceLabel").after("<br/>Use Coupon: MAGNAFLOW for an extra 5% off");
}
if ( /aeromotive/i.test($("h1").text()) ) {
$("#ctl00_MainContentPlaceHolder_YourPriceLabel").after("<br/>Use Coupon: AEROMOTIVE for an extra 5% off");
}
});

Major Improvements

  • Complete redesign of application.
  • Improved usability and performance of almost everything.
  • New autocompletes for featured products and coupons.
  • New HTML editors for homepage and content pages.
  • New code editors for custom header/footer/sidebar/stylesheet.

Renamed

@kylewest
kylewest / ga-events-add-to-cart.html
Last active July 19, 2016 18:40
fire google analytics event when user clicks add to cart
<script type="text/javascript">
$(document).ready(function(){
$(".addtocartbutton").click(function() {
// GA events.js code here
ga('send', 'event', 'Videos', 'play', 'Fall Campaign');
});
});
</script>
{
"dependencies": {
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
/*-------------------------------------------------------------------
Layout
===================================================================*/
#masterwrapper
/*Wraps the wrapper with 16px to each side*/ {
margin: 0;
width: 100%;
}
<div class="column mcb-column one column_map ">
<script>
function google_maps_56c792bbd2c7a() {
var latlng = new google.maps.LatLng(42.24, -83.44);
var draggable = true;
var myOptions = {
zoom: 6,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
styles: [{
<?xml version="1.0" encoding="utf-8"?>
<AdminDeploymentCustomizations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/wix/2011/AdminDeployment">
<BundleCustomizations TargetDir="C:\Program Files (x86)\Microsoft Visual Studio 14.0" NoCacheOnlyMode="default" NoWeb="default" NoRefresh="default" SuppressRefreshPrompt="default" Feed="default" />
<SelectableItemCustomizations>
<SelectableItemCustomization Id="TypeScriptV6" Selected="yes" FriendlyName="TypeScript 1.7.6.0 for Visual Studio 2015 Update 1" />
<SelectableItemCustomization Id="VSUV1" Hidden="no" Selected="yes" FriendlyName="Visual Studio 2015 Update 1" />
<SelectableItemCustomization Id="VSUV1PreReqV1" Selected="yes" FriendlyName="Visual Studio 2015 Update 1 Prerequisite" />
<SelectableItemCustomization Id="MicroUpdateV1.2" Selected="yes" FriendlyName="Update for Microsoft Visual Studio 2015 (KB3110221)" />
<SelectableItemCustomization Id="WebTo
@kylewest
kylewest / private.xml
Last active September 10, 2015 17:26
<?xml version="1.0"?>
<root>
<appdef>
<appname>JUMP_DESKTOP</appname>
<equal>com.p5sys.jump.mac.viewer.web</equal>
</appdef>
<windownamedef>
<name>Jump_Desktop</name>
<regex>Jump Desktop|Preferences</regex>
</windownamedef>