Skip to content

Instantly share code, notes, and snippets.

import network
import socket
import time
import struct
from machine import Pin
NTP_DELTA = 2208988800
host = "pool.ntp.org"
@bjornbennett
bjornbennett / divideProdDescriptUp.liquid
Last active March 11, 2021 13:48
Shopify Liquid - Divide product descriptions for more control
{% assign description_parts = product.description | split: '<!--split-->' %}
{%comment%}
Due to a limitation within Shopify, you have one section to write a general product description.
However, if you'd like to split sections and control them via CSS/jQuery/whatever, this provided a way to do that.
You may want the client to have access to editing the content, but you need to style the sections.
To divide sections, insert <!--split--> when you want a new section.
Shown below are snippets to use to output various sections.
Amount of parts: {{ description_parts.size }}
@seveas
seveas / rover.py
Last active July 1, 2017 20:38 — forked from andywarburton/rover.py
simple script for controlling motors and lights with piborg zero motor controller and a raspberry pi
#!/usr/bin/env python
# coding: Latin-1
# Load library functions we want
from inputs import get_gamepad
import piconzero as pz
import time
import sys
import random
import colorsys
@gbaman
gbaman / HowToOTGFast.md
Last active May 1, 2024 08:26
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i