Skip to content

Instantly share code, notes, and snippets.

View YasuakiHirano's full-sized avatar
🎮

yasuaki hirano YasuakiHirano

🎮
View GitHub Profile
let input = strftime("%A")."\n".
\strftime("%Y/%m/%d")."\n".
\strftime("%B")
let pos = getpos(".")
execute ":normal a" . input
call setpos('.', pos)
@YasuakiHirano
YasuakiHirano / exp_kana.sql
Created January 21, 2016 05:25
oracle hankaku kana check
SET SERVEROUTPUT ON
DECLARE
vstr varchar2(256):= 'ヒラノ';
BEGIN
IF (REGEXP_LIKE(vstr, '^([ヲ-゚]|[0-9A-Za-z])*$')) THEN
dbms_output.put_line('OK');
ELSE
dbms_output.put_line('NG');
END IF;
END;
command! -nargs=* StrCnt call s:StrCnt(<f-args>)
" def:文字列に連番を付ける
" param: str 文字列
" param: num 最大値
function! s:StrCnt(str, num)
let i = 0
let input = ""
while i < a:num
let input .= a:str.i."\n"
"-nargas = 0 引数なし
"-nargas = 1 1個の引数
"-nargas = * 複数
"-nargas = ? 0 or 1
command! -nargs=0 JsTemp call s:JsTemp()
command! -nargs=0 ClangTemp call s:ClangTemp()
command! -nargs=0 PhpTemp call s:PhpTemp()
command! -nargs=* SqlTemp call s:SqlTemp(<f-args>)
" @brief:Jsテンプレ出力
@echo off
set num=0
set str=www
for /L %%i in (1,1,300) do (
set /A num=num+1
mkdir %str%%%i
)
@YasuakiHirano
YasuakiHirano / hello.php
Created February 1, 2016 14:16
phpでのハローワールド
<?php
echo "hello,world!!";
@YasuakiHirano
YasuakiHirano / scrollTable.html
Last active February 10, 2016 12:32
テーブルのデータ行のみスクロールさせる
<!--demo page http://160.16.97.177/codetest/scrollTable.html-->
<html>
<head>
<meta charset="UTF-8">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$(function(){
sizeChange();
$( window ).resize(function(){
sizeChange();
:%s /\(\$("#[a-zA-Z\s\S0-9]*")\.val()\).trim()/Trim(\1)/g
Array.prototype.indexOf = function(target){
for(var i = 0; i < this.length; i++){
if(this[i] === target){
return i;
}
}
return -1;
}
function timeChangeAmPm(data){
<!DOCTYPE html>
<html lang="jp">
<head>
<meta charset="UTF-8">
<title></title>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script>
(function( $ ){
$.fn.www = function() {
var windowWidth = $(window).width();