Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Masanori Ohgita mugifly

🏠
Working from home
View GitHub Profile
@mugifly
mugifly / bg-colors.html
Created Sep 12, 2012
BGColors - multiple coloring in background-color by CSS3-gradient
View bg-colors.html
<!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 / gist:4187031
Created Dec 2, 2012
Perl - Gmail IMAP Using OAuth 2.0 (XOAUTH2)
View gist:4187031
#!/usr/bin/env perl
# Perl - Gmail IMAP Using OAuth 2.0 (XOAUTH2)
# I referred to: http://eatenbyagrue.org/tags/oauth/index.html Thank you.
use strict;
use warnings;
use utf8;
use Mail::IMAPClient;
@mugifly
mugifly / daemon.pl
Created Jan 23, 2013
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.
View daemon.pl
#!/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 / angular-filters.js
Last active Sep 5, 2018
Angular JS little filters.
View angular-filters.js
'use strict';
angular.module('foo', [])
.filter('substring', function() {
return function(str, start, end) {
return str.substring(start, end);
};
})
@mugifly
mugifly / backup-script-README.md
Last active Dec 13, 2015
backup-script.pl - Backup script for UNIX servers. (昔作った AmazonS3へのバックアップ用スクリプトです。一応動きますので公開しますw)
View backup-script-README.md

backup-script.pl - Backup script for UNIX servers.

Amazon S3へのバックアップ用スクリプトです。ディレクトリおよびMySQLデータベースのバックアップができます。

以前に作ったもので、やっつけ仕事で汚すぎるコードですが、一応動きますので公開しますw サーバのcrontabにでも登録してご自由にご利用ください。

ファイルシステムはSquashFSを用いてアーカイブされます (MySQLデータベースは、tar.gz)。

必要なパッケージ

  • CentOS/Fedora:
@mugifly
mugifly / github_webhook_updater.cgi
Last active Dec 14, 2015
GitHub Webhook receiver & updater cgi (for Hosting-web-server)
View github_webhook_updater.cgi
#!/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 / blink.css
Last active Apr 25, 2018
CSS Blink for Webkit and others. (Chrome, Safari, Firefox (Gecko), IE, ...) CSSで擬似的なblinkを再現する簡単なTips。
View blink.css
@mugifly
mugifly / bayon_simple_webapi.pl
Last active Dec 15, 2015
Bayon Simple WebAPI (with Mojolicious::Lite)
View bayon_simple_webapi.pl
#!/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 Dec 20, 2015
スケッチ: "Arduino LeonardoによるBluetoothシリアル制御のLチカ" Arduinoのシリアル通信 および Bluetoothによるシリアル通信などから制御可能。 (0 = LED消灯, 1 = LED点灯, 2 = お遊び) http://masanoriprog.blogspot.jp/2013/08/arduino-bluetooth-serial-led.html
View arduino_bluetooth-serial_led.ino
#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
@mugifly
mugifly / git-branch-clean.pl
Last active Aug 20, 2016
Git branch cleaner script - Delete a branches that not exist on remote repository. (perl 5.x)
View git-branch-clean.pl
#! /usr/bin/env perl
# Git branch cleaner ( Delete a branches that not exist on remote repository)
# If you have not ran the 'git fetch --plune' command, please try it before this script.
# Useful case (maybe): If can't delete a branches using 'git fetch --plune' command.
#
# Usage: $ perl git-branch-clean.pl --help
use warnings;
use strict;
use utf8;
You can’t perform that action at this time.