Howto add the Slick Slider to Shopify on the Home Page.

So, you’re probably here because you want to implement the slick slider on your Shopify site without using an expensive app, or, enabling it sitewide.

This quick tutorial will get you started with enabling the slick slider on your theme, on just one page (in this case, the home page). We’re only going to load the libraries required, if required, which will keep the other pages nice and fast.

First I would create a backup of your Shopify theme, and then work on it. This way you have a backup should you fuck things up.

** Note – this slider is setup for 150×80 size images. You’re pretty much for sure going to have to edit the CSS anyway, but at the bare minimum you’ll have to change those dimensions if you want different image sizes. We’re using this as a vendor/brand slider so this size is perfect.

  1. First you’re going to want to go here, and download the latest copy of the Slick library.

    http://kenwheeler.github.io/slick/

  2. Now extract the files somewhere.
  3. Now login to your Shopify Store.
  4. Go to Online Store -> Themes -> Edit HTML/CSS
  5. Now you will want to scroll down to Assets.
  6. Click Upload Asset and find your extract files, and upload these one at a time.
    slick.min.js
    slick.css
    slick-theme.css 
    fonts/slick.woff
    fonts/slick.ttf
    fonts/slick.svg
    fonts/slick.eot
  7. Modify slick-theme.css and change the font path (remove ./font/)
    src: url('./fonts/slick.eot');

    Now becomes

    src: url('./slick.eot');
  8. Open up theme.liquid and in the header section (between <head> and </head>) paste the following code
    {% if template == 'index' %}
    {% if settings.home_vendor_carousel_enable %} 
    {{ 'slick.css' | asset_url | stylesheet_tag }}
    {{ 'slick-theme.css' | asset_url | stylesheet_tag }}
    {% endif %}
    {% endif %}
  9. Now scroll down to the bottom, and right before the closing body (</body>) paste the following code
    {% if template == 'index' %}
    {% if settings.home_vendor_carousel_enable %} 
    <!-- <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script> -->
    {{ 'slick.min.js' | asset_url | script_tag }}
     <script type="text/javascript">
     $(document).ready(function() {
     $('.autoplay').slick({
     dots: false,
     infinite: true,
     speed: 500,
     slidesToShow: 5,
     slidesToScroll: 1,
     autoplay: true,
     autoplaySpeed: 2000,
     arrows: false,
     variableWidth: true
     });
     });
     </script>
    {% endif %}
    {% endif %}

    ** NOTE – we have the jquery, and jquery migrate library commented out because our theme already has it. If yours does not, you will need to uncomment the two two lines.

  10. Now, scroll up to where you want your slider and paste this code
    {% if settings.home_vendor_carousel_enable %}
    <center><h2>{{ settings.home_vendor_carousel_title }}</h2></center>
    <div class="slider-container">
     <div class="slider autoplay slider-custom">
     {% for i in (1..12) %}
     {% capture vendor %}home_vendor_enable_{{i}}{% endcapture %}
     {% capture vendor_name %}home_vendor_name_{{i}}{% endcapture %}
     {% capture vendor_logo %}vendor_logo_{{i}}.png{% endcapture %}
     {% if settings[vendor] %}
     <div>
     <a href="{{ settings[vendor_name] }}" title="{{ settings[vendor_name] }}">
     {{ vendor_logo | asset_url | img_tag: settings[vendor_name], "replace-2x img-responsive" }}
     </a>
     </div>
     {% endif %}
     {% endfor %}
     </div>
    </div> 
     <hr>
    {% endif %}
  11. Then paste this to the bottom of slick-theme.css, and edit anything you need to.
    .slider-container {
    position: relative;
    margin-top: 10px;
    left: 0;
    height: 100%;
    width:100%;
    }
    
    .slider-custom {
     width: 850px;
     margin-left: auto;
     margin-right: auto;
     display: block;
     height: 80px;
    }
    
    .slick-slide {
     width: 170px;
     padding-left: 10px;
     padding-right: 10px;
    }
  12. Now for the final change. Go back to your shopify admin interface, then to online store -> themes -> customize theme
  13. Scroll down to the config section
  14. Open up your copy of ‘settings_schema.json’
  15. Look for somewhere that makes sense (for us, we chose on the ‘home page’ section) and paste in the following keys / values
    {
     "type": "header",
     "content": "Vendor Logo Carousel"
     },
     {
     "type": "text",
     "id": "home_vendor_carousel_title",
     "label": "Vendor Carousel Title"
     },
     {
     "type": "checkbox",
     "id": "home_vendor_carousel_enable",
     "label": "Enable Vendor Carousel"
     },
     {
     "type": "checkbox",
     "id": "home_vendor_enable_1",
     "label": "Enable Vendor 1"
     },
     {
     "type": "text",
     "id": "home_vendor_name_1",
     "label": "Vendor link 1"
     },
     {
     "type": "image",
     "id": "vendor_logo_1.png",
     "label": "Icon",
     "max-width": 1000,
     "max-height": 563
     },
     {
     "type": "checkbox",
     "id": "home_vendor_enable_2",
     "label": "Enable Vendor 2"
     },
     {
     "type": "text",
     "id": "home_vendor_name_2",
     "label": "Vendor link 2"
     },
     {
     "type": "image",
     "id": "vendor_logo_2.png",
     "label": "Icon",
     "max-width": 1000,
     "max-height": 563
     },
     {
     "type": "checkbox",
     "id": "home_vendor_enable_3",
     "label": "Enable Vendor 3"
     },
     {
     "type": "text",
     "id": "home_vendor_name_3",
     "label": "Vendor link 3"
     },
     {
     "type": "image",
     "id": "vendor_logo_3.png",
     "label": "Icon",
     "max-width": 1000,
     "max-height": 563
     },
     {
     "type": "checkbox",
     "id": "home_vendor_enable_4",
     "label": "Enable Vendor 4"
     },
     {
     "type": "text",
     "id": "home_vendor_name_4",
     "label": "Vendor link 4"
     },
     {
     "type": "image",
     "id": "vendor_logo_4.png",
     "label": "Icon",
     "max-width": 1000,
     "max-height": 563
     },
     {
     "type": "checkbox",
     "id": "home_vendor_enable_5",
     "label": "Enable Vendor 5"
     },
     {
     "type": "text",
     "id": "home_vendor_name_5",
     "label": "Vendor link 5"
     },
     {
     "type": "image",
     "id": "vendor_logo_5.png",
     "label": "Icon",
     "max-width": 1000,
     "max-height": 563
     },
     {
     "type": "checkbox",
     "id": "home_vendor_enable_6",
     "label": "Enable Vendor 6"
     },
     {
     "type": "text",
     "id": "home_vendor_name_6",
     "label": "Vendor link 6"
     },
     {
     "type": "image",
     "id": "vendor_logo_6.png",
     "label": "Icon",
     "max-width": 1000,
     "max-height": 563
     },
     {
     "type": "checkbox",
     "id": "home_vendor_enable_7",
     "label": "Enable Vendor 7"
     },
     {
     "type": "text",
     "id": "home_vendor_name_7",
     "label": "Vendor link 7"
     },
     {
     "type": "image",
     "id": "vendor_logo_7.png",
     "label": "Icon",
     "max-width": 1000,
     "max-height": 563
     },
     {
     "type": "checkbox",
     "id": "home_vendor_enable_8",
     "label": "Enable Vendor 8"
     },
     {
     "type": "text",
     "id": "home_vendor_name_8",
     "label": "Vendor link 8"
     },
     {
     "type": "image",
     "id": "vendor_logo_8.png",
     "label": "Icon",
     "max-width": 1000,
     "max-height": 563
     },
     {
     "type": "checkbox",
     "id": "home_vendor_enable_9",
     "label": "Enable Vendor 9"
     },
     {
     "type": "text",
     "id": "home_vendor_name_9",
     "label": "Vendor link 9"
     },
     {
     "type": "image",
     "id": "vendor_logo_9.png",
     "label": "Icon",
     "max-width": 1000,
     "max-height": 563
     },
     {
     "type": "checkbox",
     "id": "home_vendor_enable_10",
     "label": "Enable Vendor 10"
     },
     {
     "type": "text",
     "id": "home_vendor_name_10",
     "label": "Vendor link 10"
     },
     {
     "type": "image",
     "id": "vendor_logo_10.png",
     "label": "Icon",
     "max-width": 1000,
     "max-height": 563
     },
     {
     "type": "checkbox",
     "id": "home_vendor_enable_11",
     "label": "Enable Vendor 11"
     },
     {
     "type": "text",
     "id": "home_vendor_name_11",
     "label": "Vendor link 11"
     },
     {
     "type": "image",
     "id": "vendor_logo_11.png",
     "label": "Icon",
     "max-width": 1000,
     "max-height": 563
     },
     {
     "type": "checkbox",
     "id": "home_vendor_enable_12",
     "label": "Enable Vendor 12"
     },
     {
     "type": "text",
     "id": "home_vendor_name_12",
     "label": "Vendor link 12"
     },
     {
     "type": "image",
     "id": "vendor_logo_12.png",
     "label": "Icon",
     "max-width": 1000,
     "max-height": 563
     }
  16. Now save the file.
  17. Now open your customize theme (online store -> themes -> customize theme) and go to where you setup the vendor slider.
  18. Add your images to the slider and the title / etc.
  19. Click save
  20. If you did everything right, you should see the slider now, probably needing some CSS work to position it properly.

Hope this helps someone else looking to add a custom slider to their shopify theme, while not adding it sitewide.

 

Getting NZBHydra Working on MacOS Sierra

This seems to mostly work, but still having some issues keeping it stable. Maybe this will help someone else anyway ­čÖé

Here’s what I did on Mac OSX Sierra Latest:

first:

# nano ~/Library/LaunchAgents/com.nzbhydra.nzbhydra.plist

put this (change path + username):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
 <dict>
 <key>Label</key>
 <string>com.jackett.jackett</string>
 <key>ProgramArguments</key>
 <array>
 <string>/Users/YOUR_USERNAME/NZB-APPS/nzbhydra/run.sh</string>
 </array>
 <key>RunAtLoad</key>
 <true/>
 <key>KeepAlive</key>
 <false/>
 <key>StandardErrorPath</key>
 <string>/usr/local/var/log/nzbhydra.log</string>
 <key>StandardOutPath</key>
 <string>/usr/local/var/log/nzbhydra.log</string>
 </dict>
</plist>

make this:

# nano /Users/YOUR_USERNAME/NZB-APPS/nzbhydra/run.sh

with this content (change username, and path and IP):

#!/bin/bash
/usr/bin/python /Users/YOUR_USERNAME/NZB-APPS/nzbhydra/nzbhydra.py --logfile /usr/local/var/log/nzbhydra.log --host YOUR_IP_ADD_RESS --nobrowser --daemon

save and exit then:

# chmod +x run.sh

test:

# touch /usr/local/var/log/nzbhydra.log
# tail -f /usr/local/var/log/nzbhydra.log 
# /Users/YOUR_USERNAME/NZB-APPS/nzbhydra/run.sh

you should see output and nzbyhydra should be available at http://YOUR.IP:5075
if it all runs you probably want to make it start on reboot:

launchctl load ~/Library/LaunchAgents/com.jackett.jackett.plist
launchctl start com.jackett.jackett

and here’s how you unload if you need to:

launchctl unload ~/Library/LaunchAgents/com.jackett.jackett.plist

Let me know if this helps you or have a better way by commenting!

How to update your Nexus 5x running on stock rom, TWRP with ElementalX, Magisk and PHH Superuser.

This is mainly for my own records so I don’t have to go searching again, but maybe it will help someone else. This assumes you already have ADB installed and working on your computer, and you have some knowledge of how this all works.

Here’s the steps to update your phone with the latest security updates or bootloader or radio if you’re already running magisk and phh.

      1. Grab the latest Magisk from XDA, get the Uninstaller too and transfer to your phone
      2. Grab the latest PHH SuperUser from XDA and transfer to your phone
      3. Grab the latest ElementalX Kernel and transfer it to your phone
      4. Get the factory image for your device:
        https://developers.google.com/android/nexus/images
      5. Open the zip and extract boot.img and system.img.  If there is a vendor.img, extract that too. Same for bootloader and radio if they are new. You can check the version on the bootloader screen.
      6. Reboot to bootloader, I use Reboot Manager.
      7. On your computer go to the folder where you extracted the images and flash them with the fastboot command:
        fastboot flash boot boot.img
        fastboot flash system system.img

        And if your device has a vendor.img:
        fastboot flash vendor vendor.img
        And if your device has a new radio:
        fastboot flash radio radio.img
        And if there’s a new bootloader:
        fastboot flash bootloader bootloader.img
      8. Reboot to recovery (this is very important if your data partition is unencrypted on newer devices)
      9. Flash everything in this order that you copied to the phone earlier
        1. Magisk Uninstaller
        2. Latest Magisk
        3. PHH SuperUser
        4. ElementalX
        5. (optional) custom bootanimation.zip
      10. Wipe dalvik and cache
      11. Reboot and wait a few moments and then you’re in your newly security-patched Android!
      12. You’ll probably want to install Magisk Manager and PHH SuperUser App now.

That’s it!