$ npm i -g coffee-script
$ coffee -c example.coffee
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SimpleTemplate | |
| class Renderer < OpenStruct | |
| def render(template) | |
| template.result(binding) | |
| end | |
| end | |
| def initialize(html) | |
| @template = ERB.new(html) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| use strict; | |
| use warnings; | |
| my @ar = ('a' .. 'z'); | |
| my $input = lc(shift @ARGV); | |
| die if !$input; | |
| my $sum = 0; | |
| while ($input =~ /^(.)/) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* 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; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |