Skip to content

Instantly share code, notes, and snippets.

#include "M5Atom.h"
//#define PIN_RX 22 // G0
#define PIN_RX 32 // GROVE
#define PIN_TX 26
#define PIXEL_PER_ROW 5
// Matrix Display Buffer
@kurosuke
kurosuke / neopixel-m5stickc.ino
Created February 2, 2020 12:29
neopixel sample for M5stickC
// Simple demonstration on using an input device to trigger changes on your
// NeoPixels. Wire a momentary push button to connect from ground to a
// digital IO pin. When the button is pressed it will change to a new pixel
// animation. Initial state has all pixels off -- press the button once to
// start the first animation. As written, the button does not interrupt an
// animation in-progress, it works only when idle.
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
function shortcode_open_date_view($atts = '', $content = '') {
$tz = new DateTimeZone('Asia/Tokyo');
// get now
$now = new DateTime('now', $tz);
$format = 'Y-m-d H:i:s';
// get argment
extract(shortcode_atts([
'open' => ''], $atts));
function title_save_pre($title) {
return mb_convert_kana($title, 'as')
}
add_filter('title_save_pre', 'title_save_pre', 99);
@kurosuke
kurosuke / plantuml-filter.py
Created November 6, 2017 05:04
plantuml in markdown filter for pandoc
#!/usr/bin/env python
"""
Pandoc filter to process code blocks with class "dot" into
plantuml-generated images.
"""
import subprocess
import hashlib
import os
Bleacon = require('bleacon');
Bleacon.startScanning();
Bleacon.on('discover', function(bleacon) {
console.dir(bleacon);
});
#!/bin/sh
domain=sample.com
new_user=$1
password=$2
if [ "$password" = "" ]; then
echo Usage: $0 user password
exit 1
#!/bin/sh
domain=sample.com
maildir_path=/var/vhosts
new_user=$1
password=$2
if [ "$password" = "" ]; then
echo Usage: $0 user password
@kurosuke
kurosuke / hostip.py
Created November 20, 2013 13:04
hostname convert to host ip. try mypc/mypc.local/mypc.localdomain
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import sys
def hostip(hostname):
try:
print socket.gethostbyname(hostname)
@kurosuke
kurosuke / scan_switch.py
Created December 5, 2012 11:12
Raspberry Pi GPIO(11) INPUT status check
import time
import RPi.GPIO as GPIO
# GPIO setup
GPIO.setmode(GPIO.BCM)
# GPIO11(PIN23) setup for output
GPIO.setup(11, GPIO.IN)
# default status switch off(False)