Skip to content

Instantly share code, notes, and snippets.

View aklaswad's full-sized avatar

Akira Sawada aklaswad

View GitHub Profile
#!/usr/bin/env perl
1 // <<X;
/*
X
use strict;
use warnings;
use 5.10.0;
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
# perl and node dual executable script. #
#!/usr/bin/env perl
###
use strict;
use warnings;
use 5.10.0;
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
# perl and coffee dual executable script. #
# for perl, take care no triple hash mark in script. #
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
@aklaswad
aklaswad / border-radius.html
Created April 29, 2012 00:57
Border radius
<!DOCTYPE html>
<html>
<head>
<title>Border-radius</title>
<style>
.br { max-width: 400px; height: 40px; background: #abc; margin: 5px; padding: 10px; border: 1px solid #789; }
</style>
</head>
<body>
<div class="br" style="-webkit-border-radius: 20px 0 0 0; ">-webkit-border-radius: 20px 0 0 0; </div>
@aklaswad
aklaswad / pre-commit
Created April 17, 2012 12:05
.git/hooks/pre-commit
#!/usr/bin/env perl
use strict;
use warnings;
my $diff = `git diff --cached`;
if ( my ( $ng_word ) = $diff =~ /^\+.*(Dumper|STDERR|alert|console\.log)/m ) {
print STDERR <<"ABORT";
Bad word '$ng_word' was found. git commit was aborted!
If you believe this commit is OK, use git commit --no-verify to skip this hook.
ABORT
exit 1;
@aklaswad
aklaswad / less-pad.html
Created December 17, 2011 05:37
LESS PAD
<!DOCTYPE html>
<html>
<head>
<title>LESS PAD</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://lesscss.googlecode.com/files/less-1.1.5.min.js"></script>
<script>
$( function () {
var parser = new window.less.Parser();
var parse = function () {
#!/usr/bin/perl
use strict;
use warnings;
BEGIN {
unshift @INC, '../lib';
}
use Sound::NeSynth;
@aklaswad
aklaswad / gist:1071356
Created July 8, 2011 08:15
MT::Sessionのkindメモ
AF => Activity Feed
AN => Atom Nonce
AS => Auto Save
BU => Back Up
CA => CaptchA
CC => Category Cache
CO => Cache Object
CR => Commenter Registration
CS => Cached Search?
@aklaswad
aklaswad / gist:944337
Created April 27, 2011 14:28
Testing CodeMirror2 for Movable Type template editing screen.
var re_mtignore_start = RegExp('^<m' + 't:?ignore>', 'i');
var re_mtignore_end = RegExp('</m' + 't:?ignore[^>]*?>', 'i');
var re_mttag_start = RegExp('^<[/$]?m' + 't:?[\\w:]+', 'i');
var re_mttag_end = RegExp('^[-/$]*?>', 'i');
var re_mttag_attr = RegExp('^[\\w:]+\\s*=\\s*');
var re_mttag_name = RegExp('^[\\w:]+');
var re_mttag_vatom = '(<[^>]+?>|"(<[^>]+?>|.)*?"|\'(<[^>]+?>|.)*?\'|\\w+)'
var re_mttag_value = RegExp('^' + re_mttag_vatom + '([:,]' + re_mttag_vatom + ')*' );
CodeMirror.defineMode("mtml", function(config, parserConfig) {
<mt:setvar name="foo" value="a,b,c,d,e">
<mt:setvar name="bar" value="","">
<mt:if test="@$bar = split(',', $foo)"></mt:if>
<mt:loop name="bar" glue=" + "><mt:var name="__value__"></mt:loop>​
tell application "System Events"
try
tell process "LimeChat"
tell window 1
set position to {-900, 150}
set size to {900, 610}
end tell
end tell
end try
try