Skip to content

Instantly share code, notes, and snippets.

View ptagell's full-sized avatar

Paul Tagell ptagell

View GitHub Profile
@codenamev
codenamev / button_control_led.rb
Last active December 28, 2022 10:20
Control an LED with a button using Ruby on a Raspberry Pi
#!/usr/bin/env ruby
# Original source: https://github.com/codenamev/ruby-pi/blob/master/button_control_led.rb
require "rpi_gpio"
# Set #17 as LED pin
LED_PIN_NUMBER = 17
# Set #18 as button pin
BUTTON_PIN_NUMBER = 18
@blacktm
blacktm / install_ruby_rpi.sh
Last active November 28, 2024 20:35
A Bash script to install Ruby on the Raspberry Pi
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh)
# --------------------------------------------------------------------------------------------
# Set the Ruby version you want to install
@davecap
davecap / collections.liquid.html
Last active February 11, 2025 15:00
"Infinite" scrolling in Shopify collections
{% paginate collection.products by 20 %}
<!-- the top of your collections.liquid -->
<!-- START PRODUCTS -->
{% for product in collection.products %}
<!-- START PRODUCT {{ forloop.index | plus:paginate.current_offset }} -->
<div class="product" id="product-{{ forloop.index | plus:paginate.current_offset }}">
{% include 'product' with product %}
</div>
<!-- END PRODUCT {{ forloop.index | plus:paginate.current_offset }} -->