Skip to content

Instantly share code, notes, and snippets.

View us10096698's full-sized avatar

masa us10096698

  • Tokyo, Japan
View GitHub Profile
@us10096698
us10096698 / filetypechanger.sh
Created July 1, 2014 22:32
A simple shellscript file to change the filetype of files which are in the current directory.
#!/usr/bin/sh
shopt -s extglob
for file in *.txt
do
mv ${file} ${file/%.*([^.])/.md}
done
@us10096698
us10096698 / svneraser.bat
Created April 1, 2014 01:32
Delete .svn files in subversion repository directory.
echo off
for /r %%i in ( .svn ) do ( if exist "%%i" ( rmdir /s /q "%%i"))
@us10096698
us10096698 / file_combiner.sh
Created November 1, 2013 08:41
Combine Files which specified with $1
#! /bin/sh
for fname in `find $1`
do
echo '*****'$fname'*****'
cat $fname
done
exit
@us10096698
us10096698 / enc_converter.sh
Created October 28, 2013 03:06
Japanese Kanji File Encode Converter (from CP932/ISO-2022-JP-1/EUC-JP to UTF-8 with LF)
#!/bin/sh
#
# Japanese Kanji File Encode Converter (to UTF-8)
# Usage: $ sh ./enc_converter.sh "<FilePath>"
# <Filepath> is used for argument of "ls" command.
# Ex) sh ./enc_converter.sh "~/test/*.txt"
# Expect Output of 'file' Command
cp932="Non-ISO extended-ASCII text"
jis="ASCII text"
@us10096698
us10096698 / get_own_path.sh
Created October 25, 2013 00:38
Get this Script's own Absolute Directory Path (Using `readlink -f` Command).
#!/bin/sh
mypath=`readlink -f $0`
mydir=`dirname $mypath`
echo $mypath
echo $mydir
@us10096698
us10096698 / 0_reuse_code.js
Created October 24, 2013 07:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console