Skip to content

Instantly share code, notes, and snippets.

View munky69rock's full-sized avatar
:octocat:
Colla(コラ) というサービスを開発してます

Masayuki Uehara munky69rock

:octocat:
Colla(コラ) というサービスを開発してます
View GitHub Profile
@munky69rock
munky69rock / simple-process-watcher.sh
Created July 10, 2017 09:29
Simple Process Watcher
#!/bin/bash
set -ue
keyword="$1"
time=${2:-60}
while test -n "$(ps aufx | grep $keyword | grep -v grep | grep -v $0)"; do
sleep $time
done
@munky69rock
munky69rock / activation_functions.ipynb
Created October 14, 2016 10:11
活性化関数まとめ
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@munky69rock
munky69rock / js-2015-matome.md
Created February 16, 2016 03:04
最近の混沌としたjavascript界隈まとめ(主にES6)

最近の混沌としたjavascript界隈まとめ(主にES6)

AltJs

$ npm i -g coffee-script
$ coffee -c example.coffee
@munky69rock
munky69rock / simple_template.rb
Created October 1, 2015 07:00
underscore.js like template class in ruby
class SimpleTemplate
class Renderer < OpenStruct
def render(template)
template.result(binding)
end
end
def initialize(html)
@template = ERB.new(html)
end
@munky69rock
munky69rock / method_filter.rb
Last active August 29, 2015 14:16
method hook filter for ruby
module MethodFilter
def before(hook_method, target_methods)
wrap target_methods do |instance, method, args|
instance.send hook_method
instance.send method, *args
end
end
def after(hook_method, target_methods)
#!/usr/bin/env perl
use strict;
use warnings;
# perser for http://www.phylotree.org/
use Encode qw(encode decode);
use HTML::TreeBuilder;
use JSON::XS;
#!/usr/bin/perl
use strict;
use warnings;
my @ar = ('a' .. 'z');
my $input = lc(shift @ARGV);
die if !$input;
my $sum = 0;
while ($input =~ /^(.)/) {
@munky69rock
munky69rock / responsive-background-image.css
Created July 4, 2014 16:58
Responsive Full Background Image Using CSS
/* http://coliss.com/articles/build-websites/operation/css/css-responsive-full-background-image-by-sixrevisions.html */
/* http://sixrevisions.com/css/responsive-background-image/ */
body {
background: url(background-photo.jpg) center center cover no-repeat fixed;
}
#!/bin/bash
if [ $# -gt 0 ];then
find . -type f -name "*jar" -exec bash -c "echo {}: >&2 && unzip -l {}" \; | grep $1 --color
else
echo "Usage: $0 [classname]"
fi
@munky69rock
munky69rock / setup_dti_iptables.sh
Last active August 29, 2015 13:56
simple iptables settings for DTI ServerMans@VPS
#!/bin/bash
# http://www.creativegear.jp/2011/03/29/dti-serversmanvps/
iptables -F
iptables -X
# http
iptables -A INPUT -p tcp --dport 80 -j ACCEPT