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
@mugifly
mugifly / angular-filters.js
Last active September 5, 2018 17:55
Angular JS little filters.
'use strict';
angular.module('foo', [])
.filter('substring', function() {
return function(str, start, end) {
return str.substring(start, end);
};
})
@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 / gist:4187031
Created December 2, 2012 05:01
Perl - Gmail IMAP Using OAuth 2.0 (XOAUTH2)
#!/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 / 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>