Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
# -*- coding:utf-8 -*-
import epd2in7b
import time
from PIL import Image,ImageDraw,ImageFont
import traceback
try:
epd = epd2in7b.EPD()
@margyle
margyle / add-woocommerce-product.php
Created June 4, 2018 23:41 — forked from Yame-/add-woocommerce-product.php
Adding a WooCommerce product programmatically.
<?php
$args = array(
'post_author' => 1,
'post_content' => '',
'post_status' => "draft", // (Draft | Pending | Publish)
'post_title' => '',
'post_parent' => '',
'post_type' => "product"
);
@margyle
margyle / FastLED-Sunrise.ino
Created September 18, 2017 14:14 — forked from jasoncoon/FastLED-Sunrise.ino
Simple FastLED "sunrise" example that fades from black to red, orange, yellow, and white.
#include "FastLED.h"
// How many leds in your strip?
#define NUM_LEDS 60
// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 3
#define CLOCK_PIN 13
@margyle
margyle / plot4CH_v3.pde
Created September 6, 2016 07:37 — forked from anonymous/plot4CH_v3.pde
Processing sketch to visualize and analize data from ADC's channels.
import controlP5.*;
import processing.serial.*;
boolean dataReady = false;
float offset = -1;
float voltsPerDiv = 0.5;
int ch1Color = color(255);
int ch2Color = #FF6464;
@margyle
margyle / Metronome-v1
Created August 2, 2016 18:23
Arduino Simple Metronome
/*
Simple Metronome (RThurber) v1
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
int led = 13; // LED and Piezo
int sensorPin = 0; // select the input pin for the potentiometer
int sensorValue = 0;
int metronomeBPM = 0;
MySQL
===============
Getting started: http://www.sqlteaching.com/
Related tutorial: http://cd64.de/mysql-cli
SQL joins infografic: http://cd64.de/sql-joins
#include "FastLED.h"
// DiscoStrobe
// *Flashing* rainbow lights that zoom back and forth to a beat.
// See your doctor before using this code if you have certain neurological conditions.
//
// Mark Kriegsman, July 2015
#if FASTLED_VERSION < 3001000
#include <SmartMatrix.h>
#include <FastLED.h>
const uint8_t kMatrixWidth = 32;
const uint8_t kMatrixHeight = 32;
const uint8_t kBorderWidth = 2;
#define NUM_LEDS (kMatrixWidth*kMatrixHeight)
CRGB leds[NUM_LEDS];
@margyle
margyle / rpi.md
Last active August 29, 2015 14:11 — forked from patriciogonzalezvivo/rpi.md

THE BASIC

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install avahi-daemon 

Apache Server

# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management