View put-process-status.sh
###################################################################################
# check process aliving (count process number)
# return integer 1 (process is running) or 0 (process is dead) or 9 (some error)
###################################################################################
function is_process_alive() {
count=`ps awux | grep -v grep | grep -v "$0" | grep -w "$1" | wc -l`
if [[ $count =~ ^[0-9]+$ ]]; then
if [ $count != 0 ]; then
echo 1
else
View .bash_profile
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/'
}
function promps {
local BLUE="\[\e[34m\]"
local RED="\[\e[31m\]"
local GREEN="\[\e[32m\]"
local WHITE="\[\e[00m\]"
local GRAY="\[\e[37m\]"
local MAGENTA="\[\e[35m\]"
View rand_cowsay.php
<?php
if (count($argv) < 2)
{
echo 'parameter not enough.'."\n";
return false;
}
exec('which cowsay 2>&1', $cmd_t);
if (!isset($cmd_t[0]) || $cmd_t[0] == '')
View set_bg_color.php
<?php
$fpath = $argv[1];
$o = new Bg();
$o->setBgColor($fpath);
class Bg
{
View change_default_icon.js
var icon = 'https://path-to-icon';
var hatenaid = 'michimani';
var toc = 200;
var tos = 900;
var p = document.getElementsByClassName('profile-icon');
for (var n = 0; n < p.length; n++){
p[n].src = icon;
}
window.onload = function(){
setTimeout(function(){
View hatena_sp_comment.css
.entry-comment {
border: solid 3px #000;
border-radius: 10px;
margin: 20px 0px 10px 0px;
padding: 10px 10px 5px 10px;
}
p.comment-user-name {
z-index: 999;
margin-top:-30px;
View MoveToHeader.js
$(document).ready(function(){
// 見出しタグにclass追加
$(".entry-content h1").addClass("content-h");
$(".entry-content h2").addClass("content-h");
$(".entry-content h3").addClass("content-h");
$(".entry-content h4").addClass("content-h");
$(".entry-content h5").addClass("content-h");
// 「目次」表示
View AddElementBeforeHeader.js
if (location.href.match(/michinoeki-mania\.com\/entry/)) { // Replace this with your blog domain
var j=new Date();
var f=j.getTime();
var g="";
switch (f%5) {
case 0:
g="Something 1";
break;
case 1:
g="Something 2";