Skip to content

Instantly share code, notes, and snippets.

View tree.sh
#!/bin/bash
########################## ツリー表示スクリプト ###########################
# 第一引数に与えられたディレクトリがルートのディレクトリツリーを表示する。#
# また、ディレクトリの所有ユーザ名、グループ名、パーミッションを表示する。#
# シンボリックリンク先も辿る。 #
# #
# 引数1: ツリー表示したいディレクトリパス #
# 引数2: 走査する深度(オプション) #
# #
View .vimrc
set nocompatible
filetype off
"-----------------------------
" Vundle
"-----------------------------
if has('vim_starting')
set nocompatible
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
@frah
frah / gist:5a91b2feb5a511608eecc30d9ac79297
Last active Jan 20, 2017 — forked from onozaty/gist:a684d5e8087f03bc20c6
Better checkbox field by Redmine view customize plugin(トラッカー変更対応版)
View gist:5a91b2feb5a511608eecc30d9ac79297
// Path pattern: /issues/
// Type : JavaScript
$(function() {
var ec_observer = new MutationObserver(function() {enhance_checkbox()});
var ec_target = document.getElementById('all_attributes');
ec_observer.observe(ec_target, { attributes: false, childList: true, characterData: false });
function enhance_checkbox() {
$('.check_box_group')
.each(function() {
View index.js
'use strict';
console.log('Loading function');
let doc = require('dynamodb-doc');
let dynamo = new doc.DynamoDB();
function date_desc(a, b) {
let aa = new Date(a.date);
let bb = new Date(b.date);
if (aa < bb) return -1;
@frah
frah / index.js
Last active Apr 17, 2016
Put datas received at Kinesis into DynamoDB
View index.js
'use strict';
var doc = require('dynamodb-doc');
var dynamodb = new doc.DynamoDB();
console.log('Loading function');
exports.handler = (event, context, callback) => {
event.Records.forEach((record) => {
// Kinesis data is base64 encoded so decode here
const payload = new Buffer(record.kinesis.data, 'base64').toString('ascii');
const json = JSON.parse(payload);
@frah
frah / sens-graph.js
Created Apr 17, 2016
グラフ描画(主要部のみ)
View sens-graph.js
function onMessageArrived(message) {
var j = JSON.parse(message.payloadString);
var data = undefined;
var datas = j.datas;
for (var i=0;i<datas.length;i++) {
switch (datas[i].name) {
case "watt":
data = datas[i];
break;
case "temperature":
@frah
frah / DocumentParser.patch
Last active Dec 31, 2015
KBPublisher用語集日本語キーワード対応パッチ
View DocumentParser.patch
--- old/DocumentParser.php Wed Dec 18 14:16:57 2013
+++ new/DocumentParser.php Wed Dec 18 14:18:43 2013
@@ -143,7 +143,7 @@
$ids = array();
foreach($glossary as $id => $item) {
- if(strpos(strtolower($string), strtolower($item)) !== false) {
+ if(mb_strpos(mb_strtolower($string), mb_strtolower($item)) !== false) {
$ids[] = $id;
}
@frah
frah / SendMes.vbs
Last active Dec 27, 2015
プロキシの設定を有効化するVBScript
View SendMes.vbs
Option Explicit
Dim Excel, Com
Set Excel = WScript.CreateObject("Excel.Application")
Excel.Visible = False
rem HWND_BROADCAST = 0xffff
rem WM_SETTINGCHANGE = 0x001a
rem SMTO_NOMAL = 0x0
@frah
frah / led.html
Created Oct 11, 2013
LimitlessLED control test with Lua on Nginx
View led.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>LimitlessLED control</title>
<style type="text/css">
html {
-webkit-user-select: none;
-webkit-background-size: 10px 10px;
View gist:6016248
javascript:(function(){var o=function(w,v){var i=new Blob([v]);var u=window.URL||window.webkitURL;var t=u.createObjectURL(i);var e=document.createElement("a");e.download=w;e.href=t;return e};var c=function(a){return unescape(escape(a).replace(/(%u3000|%20|%09)/g,""))};var r=document.getElementsByTagName("table")[10].innerText.trim();var d=document.getElementsByTagName("table")[11];var j=d.getElementsByTagName("tr");var s="";var n="";var h="";for(var g=0;g<j.length;g++){var l=j[g];if(l.attributes.length==0){var q=o("address.csv",n);q.innerText="[CSV Download]";l.children[0].insertBefore(q,l.children[0].firstChild);s=s+n;n="";continue}if(l.attributes[0].value=="#B0C4DE"){h=l.children[0].innerText}else{var p=l.children[1].innerText;var m=c(p.substring(0,3));p=c(p.substring(3));var f=m+","+p+","+m+" "+p;f+=","+r+","+h+",";f+=l.children[0].innerText.replace(/[A-Za-z0-9]/g,function(a){return String.fromCharCode(a.charCodeAt(0)-65248)});f+=","+l.children[2].innerText.replace(/\n/g,"");f+=","+c(l.children[3].innerTex