Skip to content

Instantly share code, notes, and snippets.

View mugifly's full-sized avatar
🏠
Working from home

Masanori Ohgita mugifly

🏠
Working from home
View GitHub Profile
/**
ArduinoProMini_FelicaPlug_Type3_RW.ino
Felica PlugのArduino向けライブラリに付属されているサンプルを基に改変
(ライブラリ: http://blog.felicalauncher.com/sdk_for_air/?page_id=2419)
**/
#define CONFIG_FELICA_PLUG_EEPROM
#include <EEPROM.h>
#include <FeliCaPlug.h>
#include <inttypes.h>
@mugifly
mugifly / dumper.lua
Created June 29, 2015 17:01
FlashAir Lua objects dumper (Make a list of tables and functions)
-- FlashAir Lua objects dumper
-- For FlashAir 3rd generation or newer
-- 1. Put this file to the root directory of the card
-- 2. Connect to card. Then access to http://flashair/dumper.lua
print("HTTP/1.0 200 OK\r\n\r\n")
for i,v in pairs(_G) do
print(i)
print(v)
local t = type(v)
@mugifly
mugifly / wercker.yml
Last active September 15, 2015 21:09
Wercker with Slack and Bitbucket (Auto deployment) for Node project - Tested in Sep 2015
box: node
build:
steps:
- npm-install
- npm-test
- script:
name: echo nodejs information
code: |
echo "node version $(node -v) running"
echo "npm version $(npm -v) running"
@mugifly
mugifly / bg-colors.html
Created September 12, 2012 00:41
BGColors - multiple coloring in background-color by CSS3-gradient
<!DOCTYPE html>
<html>
<head>
<title>BGColors Sample</title>
<script type="text/javascript" src="bg-colors.js"></script>
<script type="text/javascript">
function sampleDraw(){
new BGColors(['red','green','blue','yellow'], document.getElementById('sample'));
}
</script>
@mugifly
mugifly / wercker.yml
Last active October 28, 2015 19:41
An example of wercker.yml for test of app built with perl with carton and mysql.
# Docker container for whole process
box: ubuntu
# Additional services
services:
- id: mysql
env:
MYSQL_ROOT_PASSWORD: test
MYSQL_USER: test
MYSQL_PASSWORD: test
@mugifly
mugifly / ftp-clone.sh
Last active November 20, 2015 16:44
FTP directory clone script for Unix OS (Required: bash & wget command)
#!/bin/bash
# FTP directory clone script for Unix OS
# Required: bash & wget command
# https://gist.github.com/mugifly/931624e375d40267afc4
# Copy source (Remote FTP server)
SRC_HOST="example.com"
SRC_USERNAME="xxxx"
SRC_PASSWORD="yyyy"
SRC_DIRECTORY="/home/xxxx/src"
@mugifly
mugifly / daemon.pl
Created January 23, 2013 16:50
How to use the Morbo (include Mojolicious) as a simple http daemon. For example, it will be useful for doing development with XMLHTTPRequest(Javascript) on localhost.
#!/usr/bin/env perl
use Mojolicious::Lite;
push @{app->static->paths}, 'site/'; # File path
app->start('daemon');
# Execute this script on terminal: perl daemon.pl
# Then, let's access to http://localhost:3000/***
@mugifly
mugifly / github_webhook_updater.cgi
Last active December 14, 2015 12:38
GitHub Webhook receiver & updater cgi (for Hosting-web-server)
#!/usr/bin/env perl
# GitHub Webhook receiver & updater cgi (for Hosting-web-server)
# https://gist.github.com/mugifly/5087897/
use strict;
use warnings;
use utf8;
use lib 'lib'; # for local lib directory
use CGI;
@mugifly
mugifly / bayon_simple_webapi.pl
Last active December 15, 2015 07:19
Bayon Simple WebAPI (with Mojolicious::Lite)
#!/usr/bin/env perl
# Bayon Simple WebAPI (with Mojolicious::Lite)
# https://gist.github.com/mugifly/5222608
use Mojolicious::Lite;
use utf8;
use Mojo::JSON;
use Mojo::ByteStream;
use Mojo::Asset::File;
use Text::Bayon;
use Encode;
@mugifly
mugifly / arduino_bluetooth-serial_led.ino
Last active December 20, 2015 22:59
スケッチ: "Arduino LeonardoによるBluetoothシリアル制御のLチカ" Arduinoのシリアル通信 および Bluetoothによるシリアル通信などから制御可能。 (0 = LED消灯, 1 = LED点灯, 2 = お遊び) http://masanoriprog.blogspot.jp/2013/08/arduino-bluetooth-serial-led.html
#include <SoftwareSerial.h>
#define LED_PORT 13
#define BT_RX 11
#define BT_TX 10
// TX(RBT-001) <-> 11(Arduino)
#define PWM_WIDTH 500
// roop = 2ms