This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function title_save_pre($title) { | |
return mb_convert_kana($title, 'as') | |
} | |
add_filter('title_save_pre', 'title_save_pre', 99); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Pandoc filter to process code blocks with class "dot" into | |
plantuml-generated images. | |
""" | |
import subprocess | |
import hashlib | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bleacon = require('bleacon'); | |
Bleacon.startScanning(); | |
Bleacon.on('discover', function(bleacon) { | |
console.dir(bleacon); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
domain=sample.com | |
new_user=$1 | |
password=$2 | |
if [ "$password" = "" ]; then | |
echo Usage: $0 user password | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
domain=sample.com | |
maildir_path=/var/vhosts | |
new_user=$1 | |
password=$2 | |
if [ "$password" = "" ]; then | |
echo Usage: $0 user password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import socket | |
import sys | |
def hostip(hostname): | |
try: | |
print socket.gethostbyname(hostname) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
NewerOlder